# Trouble Storing a certain Volume State in a Scene View

**URL:** <https://discourse.slicer.org/t/trouble-storing-a-certain-volume-state-in-a-scene-view/34994>\
**Category:** Development\
**Tags:** vtk, python, views\
**Created:** [March 20, 2024, 7:45pm UTC](https://discourse.slicer.org/t/trouble-storing-a-certain-volume-state-in-a-scene-view/34994 "2024-03-20T19:45:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam-Ismaili-92](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Adam-Ismaili-92](https://discourse.slicer.org/u/Adam-Ismaili-92)\
**Post date:** [March 20, 2024, 7:45pm UTC](https://discourse.slicer.org/t/trouble-storing-a-certain-volume-state-in-a-scene-view/34994/1 "2024-03-20T19:45:46Z")

</div>

_# Consider having defined “origin” (a 3d array point), “axis1” (a 3d array axis), “alpha” (a float)_

_# Rotation process_  
_transform1 = vtk.vtkTransform()_

_transform1.Translate(-origin[0], -origin[1], -origin[2])_

_transform1.RotateWXYZ(np.degrees(alpha), axis1[0], axis1[1], axis1[2])_

_transform1.Translate(origin[0], origin[1], origin[2])_

_# Apply the rotation on axis1_  
_volumeNode.ApplyTransform(transform1)_

_# Save a scene view_  
_sceneView = slicer.mrmlScene.CreateNodeByClass(‘vtkMRMLSceneViewNode’)_

_sceneView.SetScene(slicer.mrmlScene)_

_sceneView.SetName(‘View\_1’)_

_slicer.mrmlScene.AddNode(sceneView)_

_sceneView.StoreScene()_

_# Recover the original volume by applying inverse transformation_  
_inverseTransform1 = transform1.GetInverse()_

_volumeNode.ApplyTransform(inverseTransform1)_

With the code snipped above, I have some issues storing my volume at a certain state in a view.

When I try to apply a first transformation, then take a view, and revert the transformation, the view doesn’t save the transformed state, but only the reverted state.

Can someone explain me why and help me find a solution ?
