I am experimenting with vtkSurfaceNets3D which is a great addition to VTK. In particular I am running it on a label image which derives from the segmentation of a CT scan. I am using a super simple Python test script that looks like this:
Is that the edge/boundary of your image? You can use vtkImageConstantPad first to pad the input with background values before using vtkSurfaceNets3D to close the surface.
Thank you for your feedback. Those holes do not occur at the boundary of the image “cube” but on surfaces that are fully embedded in the image volume. I am providing with this message the data and the code to reproduce the problem - if anyone is interested in doing so. Turning smoothing off, and changing parameters still resulted in holes here and there.
Best,
Andrea
P.S. below is a rendering from simply opening the output in Paraview
My suspicion is that these holes are inherent to the segmentation label data. In 3D, it’s common to see segmentations that are “inconsistent” between adjacent slices. This is hard to track down without reviewing adjacent slices etc. Have you done this?
I really appreciate your input. Can you please indicate what you would define as inconsistent? I am curious to look at the segmentation output. A “high level recipe” for what to look for would be super appreciated.
It’s hard to explain without pictures but let me try. The segmentation map is a sampling of the volume. Looking at volume slices (e.g., i-j planes), the segmentation may not “line up” well with adjacent slices, meaning that there may be caves/concave features, or isolated segmentation structures that do not gradually transition from one adjacent slice to the next. This can manifest as holes or other weird structures in the resulting surface. Basically, trying to create a smooth, nice looking surface with a relatively low sampling density can make bad things happen. This is what I suspect is happening–I suggest that you manually inspect the segmentation label map in the region of the holes and see if anything jumps out at you.