Hi all, I am looking to automate the vmtkcenterlines function in order to be able to run it on a server. It seems that my option is to have open profiles and use seed selector. This causes an issue because I need the entire processing to be automated, to open the profiles I would need to utilize something like vmtksurfaceclipper which requires a GUI. Is there any way to either automatically generate centerlines without open profiles or automatically clip ends to create open profiles?
Thanks!
You can have a look how it got fully automated in 3D Slicer’s Extract Centerline module. See source code here.
Yes, this is possible without manual GUI interaction, although the workflow in VMTK can be a bit unintuitive at first.
vmtkcenterlines fundamentally expects open surfaces because it computes paths between inlet/outlet boundaries. If your meshes are closed, you’ll usually need a preprocessing step to create openings automatically.
You don’t necessarily need vmtksurfaceclipper interactively though. A common server-side approach is:
detect vessel endpoints automatically,
clip programmatically using VTK filters,
then pass the resulting open surface into vmtkcenterlines.
A lot of people use combinations of:
vtkClipPolyData
vtkCutter
vmtksurfacecapper
or custom scripts that identify terminal branches via curvature/radius analysis.
Another option is using pointlist or idlist seed selectors instead of openprofiles if you already know approximate inlet/outlet coordinates. That can sometimes avoid the need for interactive clipping entirely.
In practice, fully automated pipelines usually rely on custom Python/VTK preprocessing before invoking the VMTK scripts themselves.
Please post such an automation workflow here, with examples and code. Over the years, I could not achieve this, so I’m eager to learn from yours.