# Extract centerline

**URL:** <https://discourse.slicer.org/t/extract-centerline/22946>\
**Category:** Support\
**Created:** [April 13, 2022, 5:55pm UTC](https://discourse.slicer.org/t/extract-centerline/22946 "2022-04-13T17:55:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![canadan](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@canadan](https://discourse.slicer.org/u/canadan)\
**Post date:** [April 13, 2022, 5:55pm UTC](https://discourse.slicer.org/t/extract-centerline/22946/1 "2022-04-13T17:55:38Z")

</div>

Can anyone tell me the basic algorithm used to extract the centerline?

As a side note, I heard a rumour that the current implementation does not properly handle noncubic voxels (ie voxels whose length, width and height are not all equal).

Thanks

dan

---

<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:** [April 13, 2022, 6:35pm UTC](https://discourse.slicer.org/t/extract-centerline/22946/2 "2022-04-13T18:35:12Z")

</div>

> [@canadan](#):
>
> I heard a rumour that the current implementation does not properly handle noncubic voxels

This would be doubtful, centerline extraction requires a surface model, either an MRML segmentation node or an MRML model node, not a volume node (completely unrelated).

---

<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 13, 2022, 7:49pm UTC](https://discourse.slicer.org/t/extract-centerline/22946/3 "2022-04-13T19:49:15Z")

</div>

You can start from a volume node but you need to segment it. In case the structure of interest has a distinct intensity range then you can easily segment it out using simple thresholding. You can use this segmentation as input for centerline extraction.

If voxels are not cubic then that does not impact centerline extraction specifically, but it is not ideal, because it means that you have less details about the geometry along certain axes. If due to this limited resolution the diameter may be reduced to 1-2 voxels then it makes sense to oversample the volume before segmentation.

---

<div class="post-metadata">

**Author:** ![canadan](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@canadan](https://discourse.slicer.org/u/canadan)\
**Post date:** [April 14, 2022, 1:06pm UTC](https://discourse.slicer.org/t/extract-centerline/22946/4 "2022-04-14T13:06:49Z")

</div>

Understood. Thanks (again) Andras for explaining the situation.

dan
