# Create axis trough cylinder model

**URL:** <https://discourse.slicer.org/t/create-axis-trough-cylinder-model/18543>\
**Category:** Support\
**Tags:** stl, 3d-model\
**Created:** [July 6, 2021, 8:13pm UTC](https://discourse.slicer.org/t/create-axis-trough-cylinder-model/18543 "2021-07-06T20:13:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sfglio](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sfglio/32/3346_2.png) [@sfglio](https://discourse.slicer.org/u/sfglio)\
**Post date:** [July 6, 2021, 8:13pm UTC](https://discourse.slicer.org/t/create-axis-trough-cylinder-model/18543/1 "2021-07-06T20:13:06Z")

</div>

I would like to create (by calculation) an axis in the middle of a cylinder (as seen in the attached file).

 ![axis](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/b/0b4f8157503d2e7f231d99c8979044a53c08a75e.png)

Is this something which could be achieved in Slicer?  
I thought of performing hole filling in advance and maybe cut the cylinder at the bottom, yet I would like to know if it would be possible to create this axis as I would like to calculate the angle between multiple scans of the same specimen…

---

<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 9, 2021, 5:30am UTC](https://discourse.slicer.org/t/create-axis-trough-cylinder-model/18543/2 "2021-07-09T05:30:58Z")

</div>

Filling the cylinder in Segment Editor is a good idea. You can then use Segment Statistics module to get the position and direction of the cylinder’s long axis.

---

<div class="post-metadata">

**Author:** ![sfglio](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sfglio/32/3346_2.png) [@sfglio](https://discourse.slicer.org/u/sfglio)\
**Post date:** [July 10, 2021, 8:21am UTC](https://discourse.slicer.org/t/create-axis-trough-cylinder-model/18543/3 "2021-07-10T08:21:48Z")

</div>

Thank you!  
Can I just choose use any random image data (e.g. from the example data) just to provide RAS coordinates to Segment editor (otherwise it does not work without providing a scalar volume)?  
I loaded the MRI head example as scalar volume.

How can I calculate now the angle between the z-axis (this should be the long-axis through the cylinder between those two segments)? (I assume the axes are vectors and represented by the coordinates x y z)

I assume that only the cylinder needs to be depicted without any other structure to make this workflow work?

 ![Bildschirmfoto 2021-07-10 um 10.15.14](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/f/dfee840ffb0302a9960c13f6fa43de606f3e3cff.png)

---

<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 13, 2021, 3:06am UTC](https://discourse.slicer.org/t/create-axis-trough-cylinder-model/18543/4 "2021-07-13T03:06:40Z")

</div>

If you use the GUI then you can use the [Specify geometry button](https://slicer.readthedocs.io/en/latest/user_guide/modules/segmenteditor.html#panels-and-their-use) to create an empty labelmap volume automatically. Alternatively, you can [create a volume from scratch](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#create-a-new-volume).
