# Extract center line from CT empty snail shell

**URL:** <https://discourse.slicer.org/t/extract-center-line-from-ct-empty-snail-shell/44456>\
**Category:** Support\
**Created:** [September 12, 2025, 2:19pm UTC](https://discourse.slicer.org/t/extract-center-line-from-ct-empty-snail-shell/44456 "2025-09-12T14:19:37Z")\
**Posts on this page:** 13\
**Page:** 2

<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:** [September 17, 2025, 1:03am UTC](https://discourse.slicer.org/t/extract-center-line-from-ct-empty-snail-shell/44456/21 "2025-09-17T01:03:16Z")

</div>

> [@kuoi](#):
>
> Regarding the start and end point for the centerline, may I know whether any point on the aperture surface would cause the same effect or not?

The centerline will end near the marked point, so make sure to mark the endpoint of the centerline near the middle of the opening.

You can increase `Oversampling` to increase accuracy. See [documentation](https://github.com/sebastianandress/Slicer-SurfaceWrapSolidify):

> - **Oversampling** : Specifies resolution during internal remeshing. Higher value results in higher accuracy but longer computation time. **Increase this value up to 2-4x if output does not follow the input segmentation accurately enough.**

It is very hard to guess how to fine-tune your results and address remaining small issues just by looking at a few screenshots. I would recommend to share a dataset (upload to dropbox, onedrive, etc. and post the link here) or bring your dataset to one of the Slicer meeting:

- [online weekly meeting](https://discourse.slicer.org/c/community/hangout/20)
- [online monthly SlicerMorph meeting](https://slicermorph.github.io/#three)
- [in-person biannual Slicer meeting](https://projectweek.na-mic.org/)

---

<div class="post-metadata">

**Author:** ![kuoi](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kuoi](https://discourse.slicer.org/u/kuoi)\
**Post date:** [September 17, 2025, 1:54am UTC](https://discourse.slicer.org/t/extract-center-line-from-ct-empty-snail-shell/44456/22 "2025-09-17T01:54:15Z")

</div>

I tried increasing oversampling from 1.5x to 2.5x, but it doesn’t help at all. I want to close the aperture, then it will probably be okay, but the editing tool in 3D slicer isn’t as flexible as Blender. So, I want to try editing the model in Blender first, then convert it to a series of TIFF photos (but everything will fail in voxelized processes).

I can share a model link here. [http://tmpfiles.org/dl/912876/slice\_0000.nrrd](http://tmpfiles.org/dl/912876/slice_0000.nrrd)

This shell has no broken structures, but you will find the aperture surface, which is not filled

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/c/4cbfee82f9af6cc1390144177eb83642cbfe23a6.jpeg)

I also need to think about how to deal with a slightly broken shell

I guess I already missed this week’s meeting, I may join next week, maybe timezone is not that friendly

---

<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:** [September 17, 2025, 5:53am UTC](https://discourse.slicer.org/t/extract-center-line-from-ct-empty-snail-shell/44456/23 "2025-09-17T05:53:35Z")

</div>

Thanks, the data file was very useful. The opening is very large, so it makes sense to close it before you extract the internal volume. You can use “Baffle planner” module (provided by SlicerHeart extension).

Here is a short video that shows the entire workflow:

[![](https://img.youtube.com/vi/m4Kt0QmmYO4/maxresdefault.jpg "Extract centerline of a shell's internal cavity") ](https://www.youtube.com/watch?v=m4Kt0QmmYO4)

---

<div class="post-metadata">

**Author:** ![kuoi](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kuoi](https://discourse.slicer.org/u/kuoi)\
**Post date:** [September 17, 2025, 6:06am UTC](https://discourse.slicer.org/t/extract-center-line-from-ct-empty-snail-shell/44456/24 "2025-09-17T06:06:28Z")

</div>

Thanks I just used another way to do similar tthing, actually your method is muchs simplier than what I did. Thanks a lot.

---

<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:** [September 17, 2025, 1:59pm UTC](https://discourse.slicer.org/t/extract-center-line-from-ct-empty-snail-shell/44456/25 "2025-09-17T13:59:21Z")

</div>

Note that the curve provided by `Extract Centerline` module’s “centerline” method finds the shortest path on the medial surface (approximated by the edges of the Voronoi diagram, purple spiky surface in the screenshot), which is not the geometric center of the cross-section for a spiral shape:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/4/c431c0e596cdef52791a4b8a04f99db687280595.jpeg)

You can use `Curved Planar Reformat` module (in Sandbox extension) to straighten the spiral and get an idea about the shape and size of the cross-sections in simple 2D images:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/9/190467fb3272a00c6c385b67a2db2bda8cc494c5.jpeg)

You can use `Endoscopy` module to fly through inside the shell to inspect segmentation quality or to get a sense of shapes and sizes inside the shell.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/8/f8c19cbb8baca48d0523fab1ebc8ff85085575e8.jpeg)

---

<div class="post-metadata">

**Author:** ![kuoi](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kuoi](https://discourse.slicer.org/u/kuoi)\
**Post date:** [September 18, 2025, 2:03am UTC](https://discourse.slicer.org/t/extract-center-line-from-ct-empty-snail-shell/44456/26 "2025-09-18T02:03:42Z")

</div>

Can I know if there is any centerline algorithm that can be perpendicular to the last plane that we sealed the shell?

---

<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:** [September 18, 2025, 2:12am UTC](https://discourse.slicer.org/t/extract-center-line-from-ct-empty-snail-shell/44456/27 "2025-09-18T02:12:44Z")

</div>

Yes, curves have a built-in algorithm for this. More specifically, its [GetCurvePointToWorldTransformAtPointIndex](https://apidocs.slicer.org/main/classvtkMRMLMarkupsCurveNode.html#ab23760b90d69d1b2e8392c75ce0a7123) method provides transforms that can be used to translate an object (such as the end plate) along the curve, with minimal spinning and rotation.

---

<div class="post-metadata">

**Author:** ![kuoi](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kuoi](https://discourse.slicer.org/u/kuoi)\
**Post date:** [September 18, 2025, 2:22am UTC](https://discourse.slicer.org/t/extract-center-line-from-ct-empty-snail-shell/44456/28 "2025-09-18T02:22:28Z")

</div>

Could you please tell me how I can use that? Do I need to use the Python console in 3D Slicer, or is there a graphical user interface available?

---

<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:** [September 18, 2025, 2:29am UTC](https://discourse.slicer.org/t/extract-center-line-from-ct-empty-snail-shell/44456/29 "2025-09-18T02:29:57Z")

</div>

No graphical user interface is provided for such specialized needs, but you need to write some Python code snippets to describe what you need exactly. Most of the code can be written by AI chatbots, but you need to be able to provide guidance for them. You can start from the Cross-section analysis module, which gets the cross-section that is orthogonal to the centerline, and modify it to use planes that are parallel to the end plate instead.

---

<div class="post-metadata">

**Author:** ![kuoi](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kuoi](https://discourse.slicer.org/u/kuoi)\
**Post date:** [September 18, 2025, 5:29am UTC](https://discourse.slicer.org/t/extract-center-line-from-ct-empty-snail-shell/44456/30 "2025-09-18T05:29:42Z")

</div>

So the main logic should be that… I list all points on that plate then tried to see if it’s perpendicular to the plate using that function?

---

<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:** [September 18, 2025, 12:16pm UTC](https://discourse.slicer.org/t/extract-center-line-from-ct-empty-snail-shell/44456/31 "2025-09-18T12:16:14Z")

</div>

You can transform the endplate normal directiom from World coordinate system to Curve coordinate system. The plane normal direction remains the same along the curve in he same direction anywhere along the curve in Curve coordinate system. You can get the plane direction in World coordinate system by using the CurvePointToWorld transformation matrix.

---

<div class="post-metadata">

**Author:** ![kuoi](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kuoi](https://discourse.slicer.org/u/kuoi)\
**Post date:** [September 19, 2025, 5:46am UTC](https://discourse.slicer.org/t/extract-center-line-from-ct-empty-snail-shell/44456/32 "2025-09-19T05:46:50Z")

</div>

Thanks, I tried a lot, however, it’s still quite difficult for me. Coding is not that big problem, the main problem is that quite a lot of API I’m not familiar with, many terms, e.g. world etc., I will think about any other solution.

---

<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:** [September 19, 2025, 4:53pm UTC](https://discourse.slicer.org/t/extract-center-line-from-ct-empty-snail-shell/44456/33 "2025-09-19T16:53:25Z")

</div>

Learning any new API is always time consuming and spending the time on it is a bit of a gamble when you are not sure yet what tools you will use in the end. Fortunately, chatbots are quite good at knowing APIs of open-source tools, such as Slicer, so you don’t have to dig into documentation or examples, just start vibe coding right away. You can also get help from community members who can help out (online, in virtual meetings, and in-person meetings) or get dedicated support from a Slicer Commercial Partner company. You are probably really close to what you need (reslicing the volume with planes parallel to the endplate is about 10 lines of quite simple Python code), but of course you can look around if you can find any tools that work better for you.

[Previous page](https://discourse.slicer.org/t/extract-center-line-from-ct-empty-snail-shell/44456.md?page=1)
