I was using the Smoothing segment editor effect recently and noticed a change in results using a typical value for Gaussian standard deviation mm.
A commit from Oct 19th, 2020 ( ENH: Add brush option to Segment Editor Smoothing effect · Slicer/Slicer@52b7208 · GitHub) included changes related to setting the standard deviation of the gaussian filter.
Previous Logic:
standardDeviationMM = self.scriptedEffect.doubleParameter("GaussianStandardDeviationMm")
gaussianFilter = vtk.vtkImageGaussianSmooth()
gaussianFilter.SetStandardDeviation(standardDeviationMM)
New logic:
radiusFactor = 4.0
standardDeviationMM = self.scriptedEffect.doubleParameter("GaussianStandardDeviationMm")
spacing = modifierLabelmap.GetSpacing()
standardDeviationPixel = [1.0, 1.0, 1.0]
radiusPixel = [3, 3, 3]
for idx in range(3):
standardDeviationPixel[idx] = standardDeviationMM / spacing[idx]
radiusPixel[idx] = int(standardDeviationPixel[idx] * radiusFactor) + 1
gaussianFilter = vtk.vtkImageGaussianSmooth()
gaussianFilter.SetStandardDeviation(*standardDeviationPixel)
Is the changes to setting a pixel value to standard deviation correct rather than a MM value? Had it been previously wrong for so long? Or was there a change in VTK about the input type of SetStandardDeviation
?
It appears it was doing gaussianFilter.SetStandardDeviation(standardDeviationMm)
since Segment Editor was introduced (ENH: Add new segmentations infrastructure · Slicer/Slicer@3ab0eab · GitHub) back in 2016.