# Calculate angular displacement of rotated DICOM data

**URL:** <https://discourse.slicer.org/t/calculate-angular-displacement-of-rotated-dicom-data/7794>\
**Category:** Development\
**Created:** [July 29, 2019, 4:53am UTC](https://discourse.slicer.org/t/calculate-angular-displacement-of-rotated-dicom-data/7794 "2019-07-29T04:53:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manuel](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Manuel](https://discourse.slicer.org/u/Manuel)\
**Post date:** [July 29, 2019, 4:53am UTC](https://discourse.slicer.org/t/calculate-angular-displacement-of-rotated-dicom-data/7794/1 "2019-07-29T04:53:37Z")

</div>

Hey there,

I would need to know the procedure (mathematical calculations) how to calculate the angular displacement (axis x, y and z) of rotated DICOM data. I already know that it is possible to access the image axis directions in RAS coordinate system from the volume, but I would need the direct calculation only out of the DICOM attributes. I also already know that the attribute (0020, 0037) “ImageOrientationPatient” includes the x and y vectors of the image and z can be calculated with the cross product of x and y. Is there also another attribute necessary to calculate the angles?

Thank you in advanced for any help.  
Manuel

---

<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 29, 2019, 6:34pm UTC](https://discourse.slicer.org/t/calculate-angular-displacement-of-rotated-dicom-data/7794/2 "2019-07-29T18:34:34Z")

</div>

ImageOrientationPatient tag everything you need to compute image axis angles relative to patient axes. There are several parametrizations available for computing angles between coordinate systems. [Euler angles wikipedia page](https://en.wikipedia.org/wiki/Euler_angles) gives a nice summary and also formulae that you can use to compute rotation angles from axis vectors.

---

<div class="post-metadata">

**Author:** ![Manuel](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@Manuel](https://discourse.slicer.org/u/Manuel)\
**Post date:** [July 29, 2019, 6:57pm UTC](https://discourse.slicer.org/t/calculate-angular-displacement-of-rotated-dicom-data/7794/3 "2019-07-29T18:57:39Z")

</div>

Perfect. It’s good to know that only the attribute is needed to calculate the angles. Then I’m not too far off with my approach.  
Thank you very much for your help.
