# segment and label components

**URL:** <https://discourse.slicer.org/t/segment-and-label-components/21853>\
**Category:** Support\
**Created:** [February 8, 2022, 2:15pm UTC](https://discourse.slicer.org/t/segment-and-label-components/21853 "2022-02-08T14:15:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lan](https://avatars.discourse-cdn.com/v4/letter/l/df788c/32.png) [@Lan](https://discourse.slicer.org/u/Lan)\
**Post date:** [February 8, 2022, 2:15pm UTC](https://discourse.slicer.org/t/segment-and-label-components/21853/1 "2022-02-08T14:15:39Z")

</div>

Hi,

I am new user and I have a stack of TIFF images generated by neutron computed tomography.  
I wonder if I can use different colors to label different components of the 3D structure based on the histogram.

Thanks for help.

---

<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:** [February 8, 2022, 2:21pm UTC](https://discourse.slicer.org/t/segment-and-label-components/21853/2 "2022-02-08T14:21:42Z")

</div>

Yes, sure, there are many ways to achieve this kind of segmentation or coloring.

You can go to Segment Editor module and for each region create a new segment and fill it using Threshold effect.

You can also do this fully automatically by copy-pasting this Python code snippet into the Python interactor: [https://gist.github.com/lassoan/5ad51c89521d3cd9c5faf65767506b37](https://gist.github.com/lassoan/5ad51c89521d3cd9c5faf65767506b37)

---

<div class="post-metadata">

**Author:** ![Lan](https://avatars.discourse-cdn.com/v4/letter/l/df788c/32.png) [@Lan](https://discourse.slicer.org/u/Lan)\
**Post date:** [February 8, 2022, 3:38pm UTC](https://discourse.slicer.org/t/segment-and-label-components/21853/3 "2022-02-08T15:38:40Z")

</div>

Thank you very much. I will try the Segment Editor first.
