# Automatation of Centerline

**URL:** https://discourse.slicer.org/t/automatation-of-centerline/30318
**Category:** VMTK
**Created:** [June 30, 2023, 11:18am UTC](https://discourse.slicer.org/t/automatation-of-centerline/30318 "2023-06-30T11:18:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Charlie\_Hayward](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/charlie_hayward/32/66528_2.png) [@Charlie\_Hayward](https://discourse.slicer.org/u/Charlie_Hayward)
#### Post date: [June 30, 2023, 11:18am UTC](https://discourse.slicer.org/t/automatation-of-centerline/30318/1 "2023-06-30T11:18:26Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [July 21, 2023, 2:10pm UTC](https://discourse.slicer.org/t/automatation-of-centerline/30318/2 "2023-07-21T14:10:52Z")

</div>

You can have a look how it got fully automated in 3D Slicer’s Extract Centerline module. See source code [here](https://github.com/vmtk/SlicerExtension-VMTK/blob/master/ExtractCenterline/ExtractCenterline.py#L327).

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [October 26, 2023, 2:55am UTC](https://discourse.slicer.org/t/automatation-of-centerline/30318/3 "2023-10-26T02:55:35Z")

</div>

3 posts were merged into an existing topic: [aneurysm removal and reconstruct the parent vessel](https://discourse.slicer.org/t/aneurysm-removal-and-reconstruct-the-parent-vessel/32304/6)

---

<div class="post-metadata">

### Author: ![Thretent](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@Thretent](https://discourse.slicer.org/u/Thretent)
#### Post date: [May 25, 2026, 10:26am UTC](https://discourse.slicer.org/t/automatation-of-centerline/30318/4 "2026-05-25T10:26:57Z")

</div>

> [@Charlie\_Hayward](#):
>
> 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!

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.

---

<div class="post-metadata">

### Author: ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)
#### Post date: [May 25, 2026, 1:40pm UTC](https://discourse.slicer.org/t/automatation-of-centerline/30318/5 "2026-05-25T13:40:13Z")

</div>

> [@Thretent](#):
>
> Yes, this is possible without manual GUI interaction

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.
