Fit splines to center of irregular 3d tube

Dear everyone,

I have a dataset with multiple structures which are shaped like irregular 3d tubes, I was wondering if it is possible to fit a spline through the approximate center of such structures (I have both isosurfaces and volume data) … Here is an example:

Like transforming the isosurfaces to solids and then calculate the centerline based on an the middle point for each coordinate

Is there any way to do so or any example that can be reutilized?

Thanks in advance


The operation you need is called skeletonization. I don’t believe VTK has a mesh skeletonizer or even a raster skeletonizer. Still, you can do it with its sister library, ITK, and you have, as you already guessed, to raster your mesh into a 3D volume: .

Alternatively, you can try CGAL for direct-from-mesh skeletonization: .

take care,


1 Like