How to set editable intensity range for individual segmentation components (each individual segment)

Hi all,

How can I set an editable intensity range for individual segmentation components separately under the Masking feature in Segment Editor? For example, I have 3 segments, A, B and C, of which each I want to limit to a unique editable intensity range to each. How can I do this without having to manually change the range for each segment?


Can you describe more about what you are trying to do? Are you trying to globally threshold different segments using the threshold effect, or are you manually painting using the masking function?


Thanks for the reply,

I am manually painting using the masking function over a CT image. For example:

Segment A: Editable intensity range = -50 to 10
Segment B: Editable intensity range = 70 to 100
Segment B: Editable intensity range = -30 to 150

It is a pain to manually adjust the range everytime for each segment!


does this helps ?

segmentsFromHounsfieldUnits = [ [“fat”, -200, -50], [“muscle”, 25, 70], [“bone”, 130, 3000] ]

from python script repository

1 Like

Hi Manjula,

Yes, this seems to be it! I am a novice user and not familiar with python - can you show me what the script will look like if I have an existing segment “Muscle” that I want to limit to -29 (min) to 150(max)?

The script will globally threshold 3 different segments to different threshold ranges which you can also do manually using the threshold effect.

I don’t know of a good way to set the mask for each segment so that when you change between them the mask threshold values will update. Have you looked into region growing methods for segmenting the different soft tissue components? It may save you a lot of time. Take a look at this video:

Whole heart segmentation from cardiac CT in 10 minutes


@Juicy @manjula thanks for the great suggestions. It is awesome to see that you’ve learnt so much about Slicer and now helping others, too! Well done.

I particularly like recommendatiom of “Grow from seeds” here, as it effectively learns the intensity range dynamically instead of trying to apply some predefined textbook values (which do not work very well, especially for soft tissues).

Pre-creating segments with fixed intensity ranges can be useful, too, at least to have a general idea about how well the different tissue types are separable with simple global thresholding.