Fill holes in 3D model

Screen Shot 2020-09-16 at 11.44.10 AM

Hi all,

I would like to fill the holes in the 3D model using some sort of interpolation. How do I do it in 3DSlicer?

These are segmentations obtained from a deep learning algorithm for cardiac MR images. The myocardium should be continuous, devoid of these holes.

Thank you,
Anshro

Convex hull may fix the outer surface. You can get it by copy-pasting this code snippet to the Python console (replace mySurface with your model node’s name):

modelNode = getNode('mySurface')

convexHull = vtk.vtkDelaunay3D()
convexHull.SetInputData(modelNode.GetPolyData())
outerSurface = vtk.vtkGeometryFilter()
outerSurface.SetInputConnection(convexHull.GetOutputPort())
outerSurface.Update()
modelNode.SetAndObservePolyData(outerSurface.GetOutput())

You may then use Segment Editor, Logical operators, maybe Wrap Solidify effect to figure out a workflow for reconstructing the inner surface.

Hi Andras,

Thank you very much for the quick reply. I tried the method you suggested. The result is - Screen Shot 2020-09-16 at 6.30.22 PM

I want only the small holes to be filled and the myocardium should be hollow. Not a solid as shown above. Is there anything we can do about that. Screen Shot 2020-09-16 at 6.30.58 PM

Thanks again,
Anshro

Convex hull was just suggested as an initial step.

There are lots of tools in Segment Editor. If the holes are small then you can fill them using Smoothing effect - “Closing (fill holes)” method. You can also go full manual and fill the holes using Paint or Draw effects.