It seems that the rewrite of vtkWindowedSincPolyDataFilter (that amazingly improved its performance) also changed how internal surfaces are smoothed. Smoothing of internal surfaces are important because when we segment a medical image we usually annotate many adjacent structures that have common surfaces and when we apply smoothing then we want to smooth surface of each structure and not just the outer surface of the entire segmented region.
The old version (VTK8) smoothed the internal surfaces, while the new version (VTK9) does not seem to smooth internal edges at all.
I’ve tried to adjust all parameters (BoundarySmoothingOn/Off, FeatureEdgeSmoothingOn/Off, NonManifoldSmoothingOn/Off, FeatureAngle, EdgeAngle, NormalizeCoordinatesOn/Off) but I could not find any settings that would smooth the internal surfaces.
@will.schroeder Is this difference expected? Could there be any preprocessing or filter parameter combination that would allow smoothing internal surfaces?
Boundary between segments are smoothed. There is some bubbling due to the strong smoothing factor (we used somewhat stronger smoothing as usual to make all differences easier to see).
Outer surface is smoothed - good. There is no bubbling (outer surface remains smooth) - good (better than the old version). However, internal edges remain sharp and jagged - not good, they are not smoothed at all.
Run the Python script below on this data set, using the old and new version of vtkWindowedSincPolyDataFilter (in the zip file I’ve included both outputs, so the results can be compared without running the script).
# WindowedSyncPolyDataFilter internal edge smoothing test reader = vtk.vtkXMLPolyDataReader() reader.SetFileName("c:/tmp/smootherinput.vtp") smoother = vtk.vtkWindowedSincPolyDataFilter() smoother.SetInputConnection(reader.GetOutputPort()) smoother.SetNumberOfIterations(100) smoother.SetPassBand(0.0001) smoother.NormalizeCoordinatesOn() smoother.FeatureEdgeSmoothingOff() smoother.SetFeatureAngle(90.0) smoother.SetEdgeAngle(15.0) smoother.BoundarySmoothingOff() smoother.NonManifoldSmoothingOn() smoother.Update() writer = vtk.vtkXMLPolyDataWriter() writer.SetInputConnection(smoother.GetOutputPort()) writer.SetFileName("c:/tmp/smootheroutput.vtp") writer.Update() writer.Write()