# Mask volume multilabel

**URL:** <https://discourse.slicer.org/t/mask-volume-multilabel/23910>\
**Category:** Support\
**Created:** [June 17, 2022, 12:08pm UTC](https://discourse.slicer.org/t/mask-volume-multilabel/23910 "2022-06-17T12:08:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bserrano](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bserrano/32/17034_2.png) [@bserrano](https://discourse.slicer.org/u/bserrano)\
**Post date:** [June 17, 2022, 12:08pm UTC](https://discourse.slicer.org/t/mask-volume-multilabel/23910/1 "2022-06-17T12:08:07Z")

</div>

Hi all,

I’ve working recently with Mask Volume from Segment Editor, is a very usefull tool in terms of image segmentation. However, it only works with binary labels. It would be possible to add a multilabel option?

I mean, if we have 2 segments and I want pixels of segment 1 to have value 5 and pixels of segment 2 to have value 10 and create a new volume with that information.

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [June 17, 2022, 12:31pm UTC](https://discourse.slicer.org/t/mask-volume-multilabel/23910/2 "2022-06-17T12:31:35Z")

</div>

Maybe export the sehmentation as a labelmap and edit the numpy array affter

---

<div class="post-metadata">

**Author:** ![bserrano](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bserrano/32/17034_2.png) [@bserrano](https://discourse.slicer.org/u/bserrano)\
**Post date:** [June 17, 2022, 1:21pm UTC](https://discourse.slicer.org/t/mask-volume-multilabel/23910/3 "2022-06-17T13:21:54Z")

</div>

Thanks, it works! Now I have pixel\_value = 1 for segment\_1 and pixel\_value = 2 for segment\_2. Are these values always generated depending on the order of the segments in the segmentation?

Do you know if I can choose the pixel value in advance?

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [June 17, 2022, 1:23pm UTC](https://discourse.slicer.org/t/mask-volume-multilabel/23910/4 "2022-06-17T13:23:12Z")

</div>

I believe you can.

Please explore the segmenetations module

---

<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:** [June 17, 2022, 7:36pm UTC](https://discourse.slicer.org/t/mask-volume-multilabel/23910/5 "2022-06-17T19:36:33Z")

</div>

You can specify what label value you want to use for each segment by using a color table.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/e/dee3fbd571a4f6237173215e8bbb921938e7e12a.png)

Color is found by matching the segment name to the color name. The assigned label value is the color’s index in the table.
