# Extract labels from labelmap

**URL:** <https://discourse.slicer.org/t/extract-labels-from-labelmap/9003>\
**Category:** Support\
**Created:** [November 3, 2019, 12:19pm UTC](https://discourse.slicer.org/t/extract-labels-from-labelmap/9003 "2019-11-03T12:19:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinny](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/vinny/32/7052_2.png) [@Vinny](https://discourse.slicer.org/u/Vinny)\
**Post date:** [November 3, 2019, 12:19pm UTC](https://discourse.slicer.org/t/extract-labels-from-labelmap/9003/1 "2019-11-03T12:19:51Z")

</div>

Hello 3d Slicer community,

I’d like to extract a specific label(s) from a segmentation labelmap that has multiple labels. I’ve had to either:

1. Use Model Maker module to generate a model of the specific label and then use Model to Label Map module to obtain the specific label that I could save in nrrd/nifti format or;

2. Use Label Map Smoothing module to extract the specific label but the result is a smoothed label.

Is there a way to extract a label directly from a segmentation labelmap without having to either generate a model or smooth the label?

Thanks,

Vinny

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 3, 2019, 1:35pm UTC](https://discourse.slicer.org/t/extract-labels-from-labelmap/9003/2 "2019-11-03T13:35:35Z")

</div>

If you import a segmentation into a labelmap then each label is listed as a separate segment. You can delete all the segments that you don’t need.

---

<div class="post-metadata">

**Author:** ![Vinny](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/vinny/32/7052_2.png) [@Vinny](https://discourse.slicer.org/u/Vinny)\
**Post date:** [November 3, 2019, 3:59pm UTC](https://discourse.slicer.org/t/extract-labels-from-labelmap/9003/3 "2019-11-03T15:59:54Z")

</div>

@lassoan: thanks that worked!
