# How to get the rotation angle after resliced the volume using two rotating orthogonal planes?

**URL:** https://discourse.slicer.org/t/how-to-get-the-rotation-angle-after-resliced-the-volume-using-two-rotating-orthogonal-planes/18176
**Category:** Support
**Tags:** python
**Created:** [June 17, 2021, 1:13am UTC](https://discourse.slicer.org/t/how-to-get-the-rotation-angle-after-resliced-the-volume-using-two-rotating-orthogonal-planes/18176 "2021-06-17T01:13:41Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)
#### Post date: [June 17, 2021, 1:13am UTC](https://discourse.slicer.org/t/how-to-get-the-rotation-angle-after-resliced-the-volume-using-two-rotating-orthogonal-planes/18176/1 "2021-06-17T01:13:41Z")

</div>

In [SlicerHeart/SlicerHeart](https://github.com/SlicerHeart/SlicerHeart), I learned the reslicing the volume using two rotating orthogonal planes. That’s great!  
I want to know how to get the rotation angle after resliced the volume using two rotating orthogonal planes in each slice.  
@lassoan , can you tell me?  
Ask grant instruction. Thank!

---

<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: [June 17, 2021, 1:46pm UTC](https://discourse.slicer.org/t/how-to-get-the-rotation-angle-after-resliced-the-volume-using-two-rotating-orthogonal-planes/18176/2 "2021-06-17T13:46:05Z")

</div>

What would you like to achieve?

For example, you can get angle between two slices as described in [this example](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#measure-angle-between-two-slice-planes).

---

<div class="post-metadata">

### Author: ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)
#### Post date: [June 17, 2021, 1:50pm UTC](https://discourse.slicer.org/t/how-to-get-the-rotation-angle-after-resliced-the-volume-using-two-rotating-orthogonal-planes/18176/3 "2021-06-17T13:50:49Z")

</div>

> [@lassoan](#):
>
> this example

I use this example in the reslicing the volume using two rotating orthogonal planes.but always 90

---

<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: [June 17, 2021, 2:00pm UTC](https://discourse.slicer.org/t/how-to-get-the-rotation-angle-after-resliced-the-volume-using-two-rotating-orthogonal-planes/18176/4 "2021-06-17T14:00:12Z")

</div>

You can change the script to compute anything you need. If you are not interested in angle between two planes then compute angle between one plane and a fixed direction.

---

<div class="post-metadata">

### Author: ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)
#### Post date: [June 17, 2021, 2:01pm UTC](https://discourse.slicer.org/t/how-to-get-the-rotation-angle-after-resliced-the-volume-using-two-rotating-orthogonal-planes/18176/5 "2021-06-17T14:01:13Z")

</div>

@lassoan I want to the rotation angle of that two rotating orthogonal planes…or said it Is absolutely not relative, or compared with the original axis…

---

<div class="post-metadata">

### Author: ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)
#### Post date: [June 17, 2021, 2:16pm UTC](https://discourse.slicer.org/t/how-to-get-the-rotation-angle-after-resliced-the-volume-using-two-rotating-orthogonal-planes/18176/6 "2021-06-17T14:16:34Z")

</div>

@lassoan in [PedicleScrewSimulator/MeasurementsStep.py at master · smclach/PedicleScrewSimulator](https://github.com/smclach/PedicleScrewSimulator/blob/master/PedicleScrewSimulator/PedicleScrewSimulatorWizard/MeasurementsStep.py), the def sliderValueChanged,  
green slicer rotate is different from Red and Yellow slice…How to correct that…

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/6/b6552ba492b6c887b981971b16fd285b2a97ca67.jpeg)

---

<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: [June 17, 2021, 2:38pm UTC](https://discourse.slicer.org/t/how-to-get-the-rotation-angle-after-resliced-the-volume-using-two-rotating-orthogonal-planes/18176/7 "2021-06-17T14:38:26Z")

</div>

> [@jumbojing](#):
>
> I want to the rotation angle of that two rotating orthogonal planes…or said it Is absolutely not relative, or compared with the original axis…

If you want to compute angle compared to a fixed axis direction then set `sliceNormalVector[1]=[1,0,0]` instead of setting it from another slice’s normal vector.

> [@jumbojing](#):
>
> he def sliderValueChanged,  
> green slicer rotate is different from Red and Yellow slice…

You can use [this script](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#set-slice-position-and-orientation-from-a-normal-vector-and-position) if you want to rotate slice _normal direction_ but keep the _up direction_ aligned with anatomical axes.

---

<div class="post-metadata">

### Author: ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)
#### Post date: [June 17, 2021, 2:50pm UTC](https://discourse.slicer.org/t/how-to-get-the-rotation-angle-after-resliced-the-volume-using-two-rotating-orthogonal-planes/18176/8 "2021-06-17T14:50:14Z")

</div>

@lassoan Thanks​:ox:🍺🐂🍺🐂🍺🐂🍺🐂🍺🐂🍺🐂🍺
