# Multiple overlapping centerlines created by vmtkcenterlinesnetwork

**URL:** https://discourse.slicer.org/t/multiple-overlapping-centerlines-created-by-vmtkcenterlinesnetwork/23180
**Category:** Support
**Created:** [April 28, 2022, 4:47pm UTC](https://discourse.slicer.org/t/multiple-overlapping-centerlines-created-by-vmtkcenterlinesnetwork/23180 "2022-04-28T16:47:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Doodads](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Doodads](https://discourse.slicer.org/u/Doodads)
#### Post date: [April 28, 2022, 4:47pm UTC](https://discourse.slicer.org/t/multiple-overlapping-centerlines-created-by-vmtkcenterlinesnetwork/23180/1 "2022-04-28T16:47:11Z")

</div>

Operating system: Ubuntu 20.04.2 LTS  
Slicer version: N.A. (using vmtk development version)  
Expected behavior: Centerlines split into two at each bifurcation. A single centerline running through each branch.  
Actual behavior: Three splits close to each other at two of the bifurcations. More than one centerline going through some branches

Dear vmtk support team,

I ran the vmtkcenterlinesnetwork on a circle of willis surface. For the most part the script was able to generate the centerlines well, except at some bifurcations and branches where multiple overlapping centerlines were observed - please refer to the attached images for a visual representation of the problem.

I suspect that the centerlines were not properly merged after they were generated. May I know how to resolve this issue? Are there some parameters I can tune or changes I can implement directly on the vmtkcenterlinesnetwork script? Thank you very much!

FYI, I am not using Slicer but the vmtkcenterlinesnetwork and I need an automated solution (i.e. without much manual input like running a script).

Regards,

Doodads

 ![Screenshot 2022-04-28 at 10.32.59 AM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/3/a3677ab23d94cb038d5323fce82568a427c378f6.jpeg)  
 ![Screenshot 2022-04-28 at 10.28.08 AM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/9/c95e7458f93581babe32c39f22774ad119c660c4.jpeg)

---

<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: [April 30, 2022, 4:26am UTC](https://discourse.slicer.org/t/multiple-overlapping-centerlines-created-by-vmtkcenterlinesnetwork/23180/2 "2022-04-30T04:26:57Z")

</div>

VMTK has two centerline extraction algorithms.

A simple one that determines centerline based only on the surface geometry. This works on arbitrary topology, such as the Circle of Willis.

And there is a more sophisticated method that computes a Voronoi diagram and searches for shortest path in between inlet and outlet points. This method provides more realistic centerline geometry, but it only works if the topology is a tree (or multiple trees). It does not work on the Circle of Willis, because the topology is not a tree. If you want to use this method on the Circle of Willis then you can extract one tree at a time (e.g., left side then the right side) and then manually merge the trees.

---

<div class="post-metadata">

### Author: ![Doodads](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Doodads](https://discourse.slicer.org/u/Doodads)
#### Post date: [May 6, 2022, 3:35am UTC](https://discourse.slicer.org/t/multiple-overlapping-centerlines-created-by-vmtkcenterlinesnetwork/23180/3 "2022-05-06T03:35:49Z")

</div>

Hi Andras, thanks for your response. May I know how to extract the trees and merge them after using vmtk? It would be great if you could share some example vmtk pypes or python code that could do this so I could go through and understand. Thanks again for your assistance!
