# Measuring in 3d CT

**URL:** <https://discourse.slicer.org/t/measuring-in-3d-ct/21510>\
**Category:** Support\
**Created:** [January 18, 2022, 6:30am UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510 "2022-01-18T06:30:50Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![akil.prabhakar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/akil.prabhakar/32/13849_2.png) [@akil.prabhakar](https://discourse.slicer.org/u/akil.prabhakar)\
**Post date:** [January 18, 2022, 6:30am UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510/1 "2022-01-18T06:30:50Z")

</div>

I am using 3d slicer for the first time. Can someone please guide me regarding how to draw a perpendicular line in 3D CT. When i try using the markup function, the angle gets calculated in a different plane. (see image 1 and 2)

 ![Picture2](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/3/2353f936096009683b45c68e68e3859de6d3ff07.jpeg)

 ![Picture1](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/7/d75cf6f13cd91436fbcdc6a93b76ef43a9634b46.jpeg)

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [January 18, 2022, 10:15am UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510/2 "2022-01-18T10:15:33Z")

</div>

Hi! Measuring and drawing are quite different operations. What do you want to achieve?

---

<div class="post-metadata">

**Author:** ![akil.prabhakar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/akil.prabhakar/32/13849_2.png) [@akil.prabhakar](https://discourse.slicer.org/u/akil.prabhakar)\
**Post date:** [January 18, 2022, 10:41am UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510/3 "2022-01-18T10:41:39Z")

</div>

I want to make 2 points on the base of coracoid( where there is a curve on the en face view of glenoid)process and extend it downwards ( this extension should be a perfect straight line ( 180 degree with the base of coracoid line). Hope you understood what I am trying to explain and thank you so much for your reply

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [January 18, 2022, 1:42pm UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510/4 "2022-01-18T13:42:08Z")

</div>

I’m not familiar with a feature that would directly achieve this.

The only thing I think of right now that only involves the GUI is to put a transform on the line and extend it by scaling it, but calculating the transform is not that straightforward (the origin needs to be carefully set).

I’d probably create a very simple Python module that takes your line and extends it by a given amount in the direction of ControlPoint0-\>ControlPoint1. This involves using the Extension wizard to create a new module, the Qt Designer to modify a bit the module GUI, and the Python code to calculate the new point and apply it. It would probably take 2 hours to an experienced Slicer programmer, but to a novice it could take weeks… not sure if anyone else has an idea.

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [January 18, 2022, 1:45pm UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510/5 "2022-01-18T13:45:34Z")

</div>

Or to go more DIY a simple Python script that you call from the console would do it too, but that little code has to be written (get vector between two points, apply it in a certain distance, set new control point 1 position).

I just tested this and it works for me:

```auto
>>> f = getNode('Model fixed points') # Replace with the name of your node (Data module, double click item name, copy)
>>> f.GetNumberOfControlPoints()
2
>>> import numpy as np
>>> p0 = np.zeros(3)
>>> p1 = np.zeros(3)
>>> f.GetNthControlPointPositionWorld(0,p0)
1
>>> p0
array([0.43038881, -4.647295 , 0.6284796])
>>> f.GetNthControlPointPositionWorld(1,p1)
1
>>> p1
array([14.29884148, -4.90982199, 21.0538559])
>>> v01 = p1 - p0
>>> p1p = p1 + v01 * 2 # Instead of "* 2" whatever elongation you want
>>> f.SetNthControlPointPositionWorld(1,p1p)

```

---

<div class="post-metadata">

**Author:** ![akil.prabhakar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/akil.prabhakar/32/13849_2.png) [@akil.prabhakar](https://discourse.slicer.org/u/akil.prabhakar)\
**Post date:** [January 18, 2022, 2:17pm UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510/6 "2022-01-18T14:17:41Z")

</div>

Thanks for your guide, but i have zero knowledge about coding and python

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [January 18, 2022, 2:25pm UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510/7 "2022-01-18T14:25:20Z")

</div>

I just did it for you. Edit my code accordingly in an editor (see the two comments), open the Python interactor in Slicer, and copy-paste the code there.

EDIT: You need to ignore the lines not starting with `>>> `, and for the rest delete the `>>> `. Then copy-paste and run.

---

<div class="post-metadata">

**Author:** ![akil.prabhakar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/akil.prabhakar/32/13849_2.png) [@akil.prabhakar](https://discourse.slicer.org/u/akil.prabhakar)\
**Post date:** [January 20, 2022, 5:36am UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510/8 "2022-01-20T05:36:54Z")

</div>

thank you so much for your help mate. But I think I am not with coding, can you suggest me some other Dicom Viewer were I would be able to do this measurements (Best DICOM viewer for measuring (angles, area of a circles, to draw a perpendicular line) in 3D CT.

Thanks again Mate

---

<div class="post-metadata">

**Author:** ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)\
**Post date:** [January 20, 2022, 8:16am UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510/9 "2022-01-20T08:16:55Z")

</div>

Horos or Osirix lite

---

<div class="post-metadata">

**Author:** ![Juicy](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Juicy](https://discourse.slicer.org/u/Juicy)\
**Post date:** [January 20, 2022, 8:19am UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510/10 "2022-01-20T08:19:36Z")

</div>

Could you explain a little more clearly what you want to do and what you are ultimately trying to measure on the scapula? I am sure 3D slicer can do what you want. If I get a bit more of an idea of exactly what you want I could make a step by step video on how to use cpinters code in slicer. It is not too complicated seeing as the code is already written.

---

<div class="post-metadata">

**Author:** ![akil.prabhakar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/akil.prabhakar/32/13849_2.png) [@akil.prabhakar](https://discourse.slicer.org/u/akil.prabhakar)\
**Post date:** [January 20, 2022, 11:54am UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510/11 "2022-01-20T11:54:27Z")

</div>

Thank you Juicy, I am doing this to check the glenoid bone loss % (% of glenoid bone loss determines the type of treatment a patient will receive). We take an en-face view of the glenoid (Glenoid facing you). we have to make two points on the base of glenoid (one superior and one inferior - on the enface view this appears like a straight line, but in reality it has a lot complicated 3d structure). Next we have to connect the two points and extend it downwards. If I am able to do this then I can calculate the glenoid bone loss from it.

Thanks again Juicy. and is it possible to draw a circle and measure the area within the circle in slicer??

---

<div class="post-metadata">

**Author:** ![akil.prabhakar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/akil.prabhakar/32/13849_2.png) [@akil.prabhakar](https://discourse.slicer.org/u/akil.prabhakar)\
**Post date:** [January 20, 2022, 11:55am UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510/12 "2022-01-20T11:55:35Z")

</div>

Thanks brother. Osirix is for Mac. I hope Horos is available for Windows!!!

---

<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:** [January 20, 2022, 12:28pm UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510/13 "2022-01-20T12:28:41Z")

</div>

> [@akil.prabhakar](#):
>
> is it possible to draw a circle and measure the area within the circle in slicer??

You should be able to do that with [this](https://github.com/vmtk/SlicerExtension-VMTK/blob/master/Docs/StenosisMeasurement2D.md) tool. Install SlicerVMTK extension in a recent preview release.

---

<div class="post-metadata">

**Author:** ![akil.prabhakar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/akil.prabhakar/32/13849_2.png) [@akil.prabhakar](https://discourse.slicer.org/u/akil.prabhakar)\
**Post date:** [January 21, 2022, 1:22pm UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510/14 "2022-01-21T13:22:37Z")

</div>

My bad Osirix and Horos are both MAC based

---

<div class="post-metadata">

**Author:** ![akil.prabhakar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/akil.prabhakar/32/13849_2.png) [@akil.prabhakar](https://discourse.slicer.org/u/akil.prabhakar)\
**Post date:** [January 21, 2022, 1:23pm UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510/15 "2022-01-21T13:23:23Z")

</div>

Thank you Chi.set, will give it a try

---

<div class="post-metadata">

**Author:** ![Juicy](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Juicy](https://discourse.slicer.org/u/Juicy)\
**Post date:** [January 26, 2022, 4:59am UTC](https://discourse.slicer.org/t/measuring-in-3d-ct/21510/16 "2022-01-26T04:59:13Z")

</div>

Ok, I still don’t understand exactly where you want the points on the glenoid. It seems that 3D slicer could do what you need but if you are not wanting to do any coding then perhaps you could try RadiAnt DICOM. It is easy to get a free trial of the software. It has a 3D MPR mode where you can orient the slice views any way through the volume and has the ability to draw perfect circles, angles in a plane and lengths. Maybe this would be an easier way to do what you want? In the image below I have loaded a scan of a scapula and reoriented the slices so the top left view is looking straight at the glenoid. I have drawn some circles, angles and lines to demonstrate the tools. RadiAnt DICOM can make a 3D model of your scan but you cant really put measurement points on the model. See if this works for you otherwise, there will definitely be ways to do it in slicer using python code. I can show you how to use the code as it is simple enough to paste code into the python interactor.

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