# Create centerlines in multiple tubes?

**URL:** <https://discourse.slicer.org/t/create-centerlines-in-multiple-tubes/46585>\
**Category:** VMTK\
**Created:** [March 26, 2026, 7:01pm UTC](https://discourse.slicer.org/t/create-centerlines-in-multiple-tubes/46585 "2026-03-26T19:01:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Morgenstern](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@Morgenstern](https://discourse.slicer.org/u/Morgenstern)\
**Post date:** [March 26, 2026, 7:01pm UTC](https://discourse.slicer.org/t/create-centerlines-in-multiple-tubes/46585/1 "2026-03-26T19:01:19Z")

</div>

Hey, I have a structure consisting of many closed, not connected tubes. I would like to know if it is possible to detect the centerlines of multiple tubes at once. I was only able to create the centerline for one tube at a time, even when setting endpoints for multiple tubes manually since the auto detection wasn’t working on this structure.

 ![Bildschirmfoto 2025-12-17 um 15.38.52](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/3/035a662e9c2cd718e47ad37f4c416a48d272123c.jpeg)

 ![Screenshot 2026-03-23 172354](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/f/9f9480a83f0acbbf99b75cc2b4421d4480f02693.jpeg)

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [March 26, 2026, 10:15pm UTC](https://discourse.slicer.org/t/create-centerlines-in-multiple-tubes/46585/2 "2026-03-26T22:15:46Z")

</div>

The ExtractCenterlines module auto detection of endpoints is designed for branching trees like vasculature or bronchial airway trees, not for multiple separate tubes. For separate tubes, just find the centerline of each one serially. You can automate this using python. You can split the each tube into a separate segment using the Islands tool, and then iterate over each segment, finding the centerline.
