# Angle measurement range

**URL:** <https://discourse.slicer.org/t/angle-measurement-range/35081>\
**Category:** Support\
**Created:** [March 26, 2024, 12:17am UTC](https://discourse.slicer.org/t/angle-measurement-range/35081 "2024-03-26T00:17:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![learn\_shape](https://avatars.discourse-cdn.com/v4/letter/l/35a633/32.png) [@learn\_shape](https://discourse.slicer.org/u/learn_shape)\
**Post date:** [March 26, 2024, 12:17am UTC](https://discourse.slicer.org/t/angle-measurement-range/35081/1 "2024-03-26T00:17:29Z")

</div>

Hello, the calculated values for both angles here are 0-90 degrees. Is there a way to change the range of values to 0-180 degrees in 3d?

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 26, 2024, 4:03am UTC](https://discourse.slicer.org/t/angle-measurement-range/35081/2 "2024-03-26T04:03:13Z")

</div>

Not entirely sure what you mean. You can have angles \>90 degrees…

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/a/1a73eb2cb90d5f7f016c2dabc273f1608fbf19d8.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:** [March 26, 2024, 4:48am UTC](https://discourse.slicer.org/t/angle-measurement-range/35081/3 "2024-03-26T04:48:10Z")

</div>

I split the topic because I interpreted the same way it as you @muratmaga but I’ve read it again and realized that maybe @learn_shape refers to the C-arm angles?

Those [angles are defined in DICOM](https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.8.7.5.html#sect_C.8.7.5.1.2). The primary positioner angle is indeed allowed to be in the +/-180deg range, while the secondary angle is always between +/-90deg. You can get the +/-180deg range if you switch to use atan2 in the [script](https://discourse.slicer.org/t/get-c-arm-angles-from-3d-view-orientation/24435/3). The end result will be something like this:

```python
    nx = viewNormal[0] # R
    ny = viewNormal[1] # A
    nz = viewNormal[2] # S
    import math
    if abs(ny) > 1e-6:
      primaryAngleDeg = math.atan2(nx, -ny) * 180.0 / math.pi
    elif nx >= 0:
      primaryAngleDeg = 90.0
    else:
      primaryAngleDeg = -90.0
    secondaryAngleDeg = math.asin(nz) * 180.0 / math.pi
    return [primaryAngleDeg, secondaryAngleDeg]

```

---

<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:** [March 27, 2024, 11:39am UTC](https://discourse.slicer.org/t/angle-measurement-range/35081/9 "2024-03-27T11:39:52Z")

</div>

In the image above the patient coordinate system is left-handed. In DICOM, patient coordinate system is right-handed (LPS). Therefore, it is quite likely thay you have fed wrong input to the code snippet.

---

<div class="post-metadata">

**Author:** ![learn\_shape](https://avatars.discourse-cdn.com/v4/letter/l/35a633/32.png) [@learn\_shape](https://discourse.slicer.org/u/learn_shape)\
**Post date:** [March 27, 2024, 12:12pm UTC](https://discourse.slicer.org/t/angle-measurement-range/35081/10 "2024-03-27T12:12:33Z")

</div>

sorry,i am a student. your code can match the body position(A P L R H F)？for example ，when body position A, lao/rao is 0 degree, and cra/cau is 0 degree

---

<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:** [March 27, 2024, 1:13pm UTC](https://discourse.slicer.org/t/angle-measurement-range/35081/11 "2024-03-27T13:13:53Z")

</div>

> [@learn\_shape](#):
>
> your code can match the body position(A P L R H F)？

DICOM names for patient coordinate system axis directions are anterior, posterior, left, right, superior, inferior.

> [@learn\_shape](#):
>
> when body position A, lao/rao is 0 degree, and cra/cau is 0 degree

Patient position is generally assumed to be head-first-supine on the C-arm table.  
Primary and secondary positioner angles refer to the viewing direction (orientation of the C-arm).

---

<div class="post-metadata">

**Author:** ![learn\_shape](https://avatars.discourse-cdn.com/v4/letter/l/35a633/32.png) [@learn\_shape](https://discourse.slicer.org/u/learn_shape)\
**Post date:** [March 28, 2024, 6:29am UTC](https://discourse.slicer.org/t/angle-measurement-range/35081/12 "2024-03-28T06:29:03Z")

</div>

but in fact the secondaryAngleDeg is allowed to be +/-180. in C arm. I wanted to modify your code to achieve an angle above 90 degrees, but it failed.

---

<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:** [March 28, 2024, 11:43am UTC](https://discourse.slicer.org/t/angle-measurement-range/35081/13 "2024-03-28T11:43:11Z")

</div>

Secondary positioner angle field cannot go beyond +/-90 degrees. See the [DICOM standard](https://dicom.innolitics.com/ciods/x-ray-angiographic-image/xa-positioner/00181511).
