vtkSurfaceNets3D and holes on the extracted surfaces

Hello Everyone,

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:

the extracted surfaces have some holes, as shown below:

Is this expected for this filter? If yes, is there a set of parameter settings that instead would guarantee there are no holes?

Thanks for any feedback,

Best Regards,

Andrea

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.

There is an issue about this here: https://gitlab.kitware.com/vtk/vtk/-/issues/19170

Hi,

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

abdominal_organ_segmentation_reduced.vtk (8.0 MB)

extract_surfaces_experiment.py (785 Bytes)

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?

Hi Will,

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.

Thank you,

Andrea

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.

It looks like that structure with the “holes" is the diaphragm, which is a few millimeter thin structure. This thickness may be comparable with the voxel size of the CT image, so having holes in that structure is the correct and expected behavior.

To get a segment without holes, you need to choose the image resolution so that the thinnest structure you are interested in is at least 4-5 voxel thick. You can change the image resolution by using the image resample filter. It seems that you used and AI segmentation model for getting the diaphragm, in which case increasing the resolution of the input image may not be sufficient, but you may need a higher-resolution model (or apply morphological closing). You can do all these easily and conveniently in 3D Slicer.