We are willing to apply this software to segment the thalamus and need to correct segmentation errors on a pixel-by-pixel basis. For this reason, we need to abolish any possible type of smoothing on the source image. Is that by any means possible?
No smoothing is done on the segmentation (the edited labelmap, which is the master representation) without user intervention. The 3D model is smoothed, but it is only extra visualization. You can turn off model smoothing using the Set surface smoothing option under the arrow next to the Show 3D button in Segment Editor.
In general, if it makes significant difference if a single voxel is inside/outside of a segment then it indicates that the data processing workflow is not optimal for segmentation. Most processing and visualization algorithms assume that the image resolution is much finer than size of details in the structures of interest - if you violate this assumption then youâll get suboptimal results. Increasing image acquisition resolution is often not feasible, but it is not a problem: you can still resample your input volume (preferably to cubic voxel size) before you segment it to avoid problems associated with insufficient image resolution.
You can use Crop volume module to resample with smaller, cubic voxels (Isotropic spacing enabled, Spacing scale set to < 1, Interpolator set to B-spline) and crop to the region of interest (to make sure the output image will not get too big due to the smaller voxel size).
About this 3D surface smoothing; I know that when you export your 3D surface smoothed segment as a STL, the viewport smoothing is also applied on the final exported STL.
But what method is used for this smoothing? Which algorithm and settings do I have to use to perform the same smoothing on for instance a labelmap?
In other words; can exactly the same procedure be done afterwards and how?
Or is that a well kept secret?
Iâm asking this because Iâm trying to mimic a smoothing method thatâs used by the applications âMimicsâ and â3D-Maticâ (both products of Materialise). Itâs proprietary software, so they wonât let you how they do their thing.
Smoothing is not actually applied when exporting. Whatever you have as closed surface representation, that is what is exported. If you disable smoothing when editing, then it wonât be smoothed.
Nothing is a secret in Slicer Flying edges is used for smoothing. See usage here
Yes! This is an underutilized feature in the segmentation infrastructure: you can specify any number of alternative conversion rule(s) that can get from a binary labelmap to a closed surface representation. The conversion path with the smallest cost is used by default, but to can choose alternative path when you click on Update in the representation list in Segmentations module.
Is it the method you said? It seems some parameters can be changed, but the method canât be changed to another smoothing one. Actually, I just want to see the segmentation result without any postprocessing like the example from VTK.
Smoothing step is part of the reconstruction. It is not some optional postprocessing step that you may or may not want to have. If you donât apply smoothing then you will get a surface corrupted with aliasing artifacts (staircases), which are not there in the continuous signal. Therefore, you should not disable smoothing by default.
Of course, you can do everything in Slicer. So, if you decide that you always want to have artifacts in the reconstructed surface then you can change the default by adding these lines to your .slicerrc.py file:
# Note: running this code is not recommended, as it introduces artifacts in the reconstructed surface
defaultSegmentationNode = slicer.vtkMRMLSegmentationNode()
defaultSegmentationNode.GetSegmentation().SetConversionParameter("Smoothing factor", "-0.5") # use negative number to make it easy to enable smoothing
slicer.mrmlScene.AddDefaultNode(defaultSegmentationNode)
In the first one, there is no surface smoothing in 3D. In the second image, surface smoothing is at default 0.5.
We see that the contrasted structure is better filled without surface smoothing in the the 3D view. The slice view outlines the contrast as reference.
Should we consider that surface smoothing should be applied in 2D views to remove what is considered as artifacts? But the contrast pleads against this.
Yes it is indeed due to scenarios like this one that I did not want to have any smoothing. I tried the code suggested:
defaultSegmentationNode = slicer.vtkMRMLSegmentationNode()
defaultSegmentationNode.GetSegmentation().SetConversionParameter("Smoothing factor", "-0.5") # use negative number to make it easy to enable smoothing
slicer.mrmlScene.AddDefaultNode(defaultSegmentationNode)
However, it did not work as I hoped. I want to make it so that whenever I load a segmentation and click âShow 3Dâ the visualisation has a smoothing factor of 0. However, after adding this code to .slicerrc.py, the default smoothing factor is still 0.5. I really want to change this default setting as in my workflow I have to load many segmentation files, and each time I have the change the smoothing factor manually.