New Segment Editor effect: Local threshold

Local threshold, a new semi-automatic segmentation method, has been added to the Segment Editor. It is available in both the 4.11.0 and 4.10.2 releases through the SegmentEditorExtraEffects extension. This effect adds connected voxels to segments that are within a specified threshold, and attempts to prevent leaks into other structures through small connecting regions. The result is similar to that of the “Level trace” effect in that it delineates a region within a certain threshold value, however this effect is applied in 3D.

The initial behavior is similar to the threshold effect. Users can specify a threshold range manually, or by drawing on the image to create a histogram (see info here). Instead of clicking “Apply”, CTRL+clicking on a specific region performs a flood fill using one of 3 algorithms, adding the structure to the current segment:

  • Masking
  • GrowCut
  • WaterShed

Two additional parameters are also available to prevent leaks:

  • Feature size: Used to separate structures that are connected by regions smaller than the size specified
  • ROI: Only voxels within the region of interest will be filled

Suggestions and feedback are welcome.

Development was funded in part by CANARIE’s Research Software Program, OpenAnatomy, and Brigham and Women’s Hospital through NIH grant R01MH112748.

3 Likes

Hi,

I found it a very nice feature. However, while trying to use it, i found that after selecting a threshold and ctrl plus left click-it doesn’t do anything. I mean no filling is done. Is there anything I am missing?

Thanks,
Sarv

Local threshold effect attempts to reduce leaking and separates the structure that you clicked on by eroding the thresholded area by the “feature size” parameter.

If the area under the mouse would be eroded away, then the local threshold effect will not find the structure. If you reduce the “feature size” parameter, or make sure to click in a non-eroded region, than it should help find the structure.

1 Like

Late reply and perhaps this is documented somewhere else, but on MacOS it is command-click to add, not control-click.

Most excellent feature, by the way. Thanks!

1 Like

I still don’t succeed on MacOS:
After selecting the right threshold and after I click cmd+left mouse button it does not add the blinking area to the segmentation?
anyone has a solution for that behaviour?

Did you try it with a sample data download like from the video?

Yes! But I don’t get it: pressing cmd+left click (I assume mouse left click) - where (in which window) and when should I press these buttons???

e.g if I use level tracing than I just need to left-click on the mouse and I immediately see the segmented area - however in local threshold the region is getting lighter and darker green constantly but if I press cmd+left click nothing happens…

That part that you Ctrl-Click on is added to the segment. If nothing is added then it means that the region found at the clicked position is smaller than the feature size. You need to extend the threshold range or decrease “Feature size”.

In the meantime I accidentially! managed to add a part to the segment, however repeating fails…no matter what feature size I choose (1-10cm) for my threshold, I can’t segment the implant.

Have you tried lowering the feature size all the way to 0?

2 Likes

Thanks for this hint! now it works very smooth!

I want to most accurately segment the implants (as shown in the figure above) in order to measure the blooming artefact - which algorithm would be the one of choice?
e.g. after using watershed, creating a labelmap and superimposing it with the original scan -> I still can see a thin (white/greyish) border around my segmented implant before the adjacent black circle.
Or would you recommend any other algorithm in order to measure blooming?

1 Like

The “difference” is probably not real, it is probably just a result of using linear interpolation for grayscale volumes and nearest neighbor interpolation for segmentation’s binary labelmap representation. You can verify this by disabling interpolation for the volume. You can reduce the difference between these interpolations by reducing the pixel spacing of the input volume (for example, by using Crop volume module) before you start segmentation.

1 Like

Hi Kyle Sunderland,
A very nice function in Local Threshold. But I found it is difficult to understand clearly.How to define the Minimum, Lower, Average, Upper and Maximum value in Local histogram? What the meaning about the red line, yellow line and the curve between them? Moreover, how to set the Feature Size basing on the Volume?
Thanks,
Dr.Xie

The histogram represents the voxel intensities within the selected region of the image. The red lines on the left and right represent the minimum and maximum voxel intensities in the selected region, while the the the yellow line represents the average intensity. The yellow highlight underneath the histogram shows the current threshold range.

Clicking and dragging on the histogram will let you manually specify the minimum/maximum intensities. The average then becomes the median intensity between the two. Right clicking on the histogram will cancel the manual selection.

If you would like finer control over the threshold range, the threshold range slider can be used without, or in conjunction with the histogram to specify the range.

The required feature size depends on the structure being segmented. A larger feature sizes will prevent leaking through regions that are smaller than the feature size, however for thin structures, a feature size that is larger than the thinnest regions will result in the branches being truncated.

@Sunderlandkyl This is an excellent summary! It would be great if you could add that to https://github.com/lassoan/SlicerSegmentEditorExtraEffects/blob/master/README.md (maybe with an additional annotated screenshot). This documentation will be moved to Slicer core documentation when the effect is moved into the Slicer core.

1 Like

Hi, I’m trying to use this effect as it is used in your video, but I’m unable to draw a region in the image to obtain a local histogram, nor do I have the local histogram graph visible. Did I somehow not install the correct extension? This is what my control panel looks like:

@Henry_Cope which version of Slicer are you using? The Histogram is not available in Slicer 4.10.2.

Ah then that’s the issue! I’m using 4.10.2.
Thank you