Option to disable smoothing of the segment surfaces in Segment Editor

I think it might be helpful to add an option to Segment Editor to disable smoothing of the surface when generating it from the label map representation. When regions are small, smoothing can lead to significant under-estimation of the boundary, as shown in the screenshot below.

Of note, the option to disable smoothing was available in the legacy editor.

The segmentation dataset used in this example is publicly available in the TCIA QIN-HEADNECK collection, and can be downloaded using the TCIABrowser extension. You will need to install Quantitative Reporting extension first to be able to load DICOM SEG series. The details on patient/study/series are shown below.

image

What smoothing is used?

It’s true that smoothing parameter requires a lot of clicks. I’ve added a ticket to the issue tracker to address it: https://issues.slicer.org/view.php?id=4415

1 Like

vtkWindowedSincPolyDataFilter is used, see the filter setup code here: https://github.com/Slicer/Slicer/blob/481873378dfbbdbe2b17db8feedf11496280b9ba/Libs/vtkSegmentationCore/vtkBinaryLabelmapToClosedSurfaceConversionRule.cxx#L197-L212

Maybe we could normalize default PassBand cutoff frequency by the spacing of the input binary labelmap to not require any tuning based on the voxel size.

Have you considered a “cubes” display. It shows each vowel on the surface of the segmentation. Here is an example from the BWH Brain Atlas.

The left image is smoothed, the right image shows cubes.

1 Like

I can imagine that for certain applications cube may be acceptable but it often provides very poor results (you cannot even make out the shape of a segment).

If smoothing is done right, it just removes artifacts due to finite resolution. If relevant details are lost as a result of smoothing (there is no smoothing factor that removes staircase artifacts without removing relevant details) then it means that a supersampled binary labelmap or a fractional labelmap has to be used.

Cubes are useful when editing, not as a final rep. You can see each vowel.

Not sure of the units. I always use .001 for bandpass

To produce the final smoothed models, you should process all labels at once. Segments that touch will remain touching after smoothing. If the entire volume is segmented, this will reduce the shrinkage.

This example does that.
https://lorensen.github.io/VTKExamples/site//Cxx/Medical/GenerateModelsFromLabels/

Segments are independent volumes that may even overlap each other, but we do use this joint smoothing technique when we apply smoothing to modify segments (to remove noise or segmentation errors). For display, we only apply just as much smoothing to remove staircase artifacts.

Do you think it would make a difference if we didn’t just smooth a structure as is but we add a “negative” structure around it and smooth together? (other than of course that the structure’s surface will not be treated as a boundary anymore, so BoundarySmoothing flag will have no effect)

What filter do you use to generate the cubes display? Is it faster than marching cubes?

Setting smoothing factor to 0 in the “Advanced segmentation conversion” setting produces the result I wanted to see in this example. I think adding a checkbox somewhere in Segment Editor that would effectively reset this parameter to 0 would be helpful, and would provide functionality equivalent to what was available in the old Editor.

image

It’s fast. It does not use a filter. It converts point data to cell data.

See:
https://lorensen.github.io/VTKExamples/site/Cxx/Medical/GenerateCubesFromLabels/

This version saves each model in a file. If could be convetted into a
command line module.

Thank you, I’ll have a look at this.

This is implemented now in Slicer master branch and should be available in tomorrow’s nightly build. A checkbox is available directly in the “Show 3D” button’s menu:

image

3 Likes

A post was merged into an existing topic: Surface smoothing and exporting model