Centerline extraction

I am new to VTK. I have a 3D model of a tubular structure and I am looking for a way to extract the centerline for it. Could someone help?

So far, I have tried using VMTK but it requires a closed model (end points are closed), but in my case I have a model with open ends. I read in one of the forums that one can use vmtkNetworkExtraction but I am not having much success with it.

I am looking for suggestions on how I can extract the centerline for this model. Thank you.

Hi Anant

I had the same problem a while ago. I created a small clipper tool which can be used for closing the surface. https://kitware.github.io/vtk-examples/site/Cxx/Meshes/CapClip/ is a good starting point. You can use the vtkPlaneWidget for moving a plane around interactively for cutting your mesh. After cutting, you can use vtkAppendPolyData for joining the boundary and the output of the clipper and afterwards you can use vtkCleanPolyData

I also used VMTK for centerline extraction, but I found binary thinning good enough for my purpose.

/Jens

Thanks Jens. A stupid question. How do I select the location of the clipping plane? Can this be done interactively? I have multiple locations where I would need to close the surface.

I managed to convert my model to a volume and then use VMTK.

I am glad you found out. If you want to select a clipping plane interactively, I can recommend using the vtkPlaneWidget. It has some issue with scaling the handles properly, but it does the job.