Visual intensity mask with mouse gesture controls

The intensity mask can be a useful feature when doing manual segmentation, especially for the Draw and Erase tool:

But in practice it is cumbersome: I have to look at values in Data probe and use this as a setting. I suggest a visual representation when intensity mask is on:

This makes it easy to fill out contours in an efficent way since you can see if your intensity mask setting is good.

While a visual intensity mask will make these tools better, you will still have to set your intensity mask values in the toolbar. Therefore I suggest the following mouse gestures in a slice view window when intensity mask is on:

  • Ctrl + Left Drag : Change intensity mask minimum value. Update visual mask continuously. Keep tool cursor at same place so you can continue draw when you find your correct setting.
  • Ctrl + Shift + Left Drag : Same as above but with fine precision increments like 1/10th of the above . This is how Blender does it.

Is this a feature that can be added to Slicer? I would love this feature since manual segmentation is a craftmanship that can be exhausting.

The preview is available in Threshold effect. You can also draw on the image to compute image intensity histogram of that region and specify the threshold range based on that histogram (either using min/mean/max values or by click-and-dragging the position markers in the histogram):

In the end, click “Use for masking” to set the range as “Editable intensity range”.

Is there any need that is not covered by these features?

1 Like

Local histogram is a nice feature. But it is still cumbersome to set the intensity mask values by hand. I would really appreciate the above suggested feature. This way you can change the intensity mask value on the fly, adjusting it to your needs while you draw manually. Segmentation is a time consuming process especially if you need to take special care of the small details. An effective UI design with handy shortcuts really helps.

I can see how a preview of a thresholded paint stroke could look nice and it would make intensity range adjustment easier. However, implementation workload of this feature would be significant and its use for medical image segmentation would be quite limited. The reason for limited use is that threshold value should not be adjusted for individual paint strokes, and not even for slices, because that would result in inconsistent (dependent on slice orientation, display settings, operator, etc.) and noisy segmentation (due to neighbor slices being segmented independently). Instead, there are two main approaches that are typically followed:

  • If there is a good global threshold value for an entire structure then use Threshold effect (with a few extra clicks, reproducible threshold value setting, for example as a mid-point between two histogram peaks) to determine that threshold value and use that consistently throughout the segmentation.
  • If there is no threshold that works well across the entire structure then the solution is not to manually alter the threshold, but let “Grow from seeds” (or Watershed, Fast marching, etc.) method determine the optimal threshold value for each voxel, in 3D, based on the inputs you give and all the local intensity variations of the underlying image.

What structures are you segmenting on what kind of images?
How do you segment them now?

I can see that implementing this feature could be time consuming. This was just a suggestion for something I would find handy.

The problem with interpolation between layers could be a problem. But manual drawing is worse. Manual drawing often creates a mesh looking like stairs. Drawing with an intensity mask (manually between slices (or sphere brush?)) will probably create a smoother interpolation just like thresholding.

I’ve been working with models of congenital heart diseases where the CT images of the small patients often are diffuse because of radiation concerns for children. This often creates the need for manual post drawing. I also been segmenting orbita fractures where the details often must be enhanced with manual drawing (I know about this post). I often find it easier/effective to go through the segmentation slice by slice to fix it. Here is how I would use my suggested effect for orbitas (pink color to clearify):

Exactly! You must work with the same threshold value across the entire structure (not change the threshold value slice by slice) if you want to avoid staircasing. This is why a tool that would make it easy to change the threshold value between slices based on visual feedback would not be useful (because it would introduce staircasing). You can set an editable intensity range and then use Paint with a large sphere brush, or use Scissors or Surface cut to quickly segment your region of interest, then disable thresholding and go slice by slice to fix small errors.

If a single global threshold value does not work well then “Grow from seeds” effect is more appropriate, as it relies on local intensity changes in 3D (not just slice by slice).

If you segment very thin structures (orbital wall, heart valve leaflets or septum) then due to partial volume effect and noise the structure may disappear (become indistinguishable from the surrounding tissue). In these cases it can be easier to segment the cavity or the structures on both sides of the membrane and then create the thin boundary structure using Hollow effect.