# Rotate Views Without Rotating Image

**URL:** https://discourse.slicer.org/t/rotate-views-without-rotating-image/776
**Category:** Support
**Tags:** visualization, views
**Created:** [July 27, 2017, 2:52pm UTC](https://discourse.slicer.org/t/rotate-views-without-rotating-image/776 "2017-07-27T14:52:09Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![\_jmichael](https://avatars.discourse-cdn.com/v4/letter/_/ce7236/32.png) [@\_jmichael](https://discourse.slicer.org/u/_jmichael)
#### Post date: [July 27, 2017, 2:52pm UTC](https://discourse.slicer.org/t/rotate-views-without-rotating-image/776/1 "2017-07-27T14:52:09Z")

</div>

Hi all,  
I currently have a micro-CT of a phantom that, when loaded into Slicer, appears upside down (there are some file conversions going on before I get to Slicer, so this behaviour is probably correct from a software perspective). Is there a way to rotate my view of the image (e.g. rotate my view of the red slice 180 degrees) without moving the image itself? (e.g. by using the transforms module)

I’ll eventually be segmenting certain structures and performing a surface based registration to other CT images, so while using the transforms module would work, it would mean another transform/coordinate system to keep track of. My problem is really only with visualization so I’d like to avoid that if possible.

Thanks in advance!

---

<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 27, 2017, 3:05pm UTC](https://discourse.slicer.org/t/rotate-views-without-rotating-image/776/2 "2017-07-27T15:05:53Z")

</div>

You can use Reformat module to set arbitrary orientation of slice views.

---

<div class="post-metadata">

### Author: ![\_jmichael](https://avatars.discourse-cdn.com/v4/letter/_/ce7236/32.png) [@\_jmichael](https://discourse.slicer.org/u/_jmichael)
#### Post date: [July 27, 2017, 3:09pm UTC](https://discourse.slicer.org/t/rotate-views-without-rotating-image/776/3 "2017-07-27T15:09:58Z")

</div>

Perfect. Just tried and that’s exactly what I was looking for.

Thanks!

---

<div class="post-metadata">

### Author: ![Nicolas\_Tempier](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nicolas_tempier/32/17463_2.png) [@Nicolas\_Tempier](https://discourse.slicer.org/u/Nicolas_Tempier)
#### Post date: [August 16, 2023, 10:17am UTC](https://discourse.slicer.org/t/rotate-views-without-rotating-image/776/4 "2023-08-16T10:17:35Z")

</div>

Dear @lassoan ,  
would there be a python script equivalence to this Reformat change please ?

Respectfully,

Nicolas

---

<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: [August 16, 2023, 10:32am UTC](https://discourse.slicer.org/t/rotate-views-without-rotating-image/776/5 "2023-08-16T10:32:54Z")

</div>

In recent Slicer-5.3 versions (and in the soon-to-be-released Slicer-5.4 stable version) you can rotate slices easily like this:

```python
slicer.vtkSlicerReformatLogic.RotateSlice(getNode('vtkMRMLSliceNodeRed'), 0, 180)

```

First argument is the slice node, second is the rotation axis index (0, 1, or 2 = horizontal axis, vertical axis, slice normal), third is the rotation angle (180 for flip, 90 for rotation).

---

<div class="post-metadata">

### Author: ![Nicolas\_Tempier](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nicolas_tempier/32/17463_2.png) [@Nicolas\_Tempier](https://discourse.slicer.org/u/Nicolas_Tempier)
#### Post date: [August 16, 2023, 12:02pm UTC](https://discourse.slicer.org/t/rotate-views-without-rotating-image/776/6 "2023-08-16T12:02:11Z")

</div>

Thank you very much !

---

<div class="post-metadata">

### Author: ![baderstine](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/baderstine/32/79333_2.png) [@baderstine](https://discourse.slicer.org/u/baderstine)
#### Post date: [February 4, 2025, 11:03pm UTC](https://discourse.slicer.org/t/rotate-views-without-rotating-image/776/7 "2025-02-04T23:03:44Z")

</div>

In Slicer 5.6.2, I noticed that when i toggle on/off a vtkMRMLScalarVolumeNode in the Data module, any rotation that i’ve applied gets reset to the default.

Is there a way to set a default value with rotation applied?

I tried this:

```auto
slicer.vtkSlicerReformatLogic.RotateSlice(slicer.util.getNode('vtkMRMLSliceNodeRed'), 2, -90)
orientation = slicer.app.layoutManager().sliceWidget("Red").sliceLogic().GetSliceNode().GetOrientation()
slicer.app.layoutManager().sliceWidget("Red").setSliceOrientation(orientation)

```

which returns the following error:

> [VTK] GetSliceOrientationPreset: invalid orientation preset name: Reformat

since orientation = “Reformat” a string that is not ‘Axial’, ‘Sagittal’, ‘Coronal’, etc.
