# Get volume orientation after hardening a transformation

**URL:** https://discourse.slicer.org/t/get-volume-orientation-after-hardening-a-transformation/8326
**Category:** Development
**Tags:** dicom
**Created:** [September 6, 2019, 5:23pm UTC](https://discourse.slicer.org/t/get-volume-orientation-after-hardening-a-transformation/8326 "2019-09-06T17:23:41Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![giovform](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/giovform/32/4687_2.png) [@giovform](https://discourse.slicer.org/u/giovform)
#### Post date: [September 6, 2019, 5:23pm UTC](https://discourse.slicer.org/t/get-volume-orientation-after-hardening-a-transformation/8326/1 "2019-09-06T17:23:41Z")

</div>

Hi, I just would like the get the volume orientation after hardening a transformation. Is it possible?

Thank you in advance, excellent software.

---

<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: [September 6, 2019, 5:26pm UTC](https://discourse.slicer.org/t/get-volume-orientation-after-hardening-a-transformation/8326/2 "2019-09-06T17:26:00Z")

</div>

You can get IJK axis directions in RAS coordinate system by calling [GetIJKToRASDirections()](https://apidocs.slicer.org/master/classvtkMRMLVolumeNode.html#aecba65818d6210c412b5c4f319e7cb6e) or [GetIJKToRASMatrix()](https://apidocs.slicer.org/master/classvtkMRMLVolumeNode.html#ac219b18e05335a172a2128d615153ddf) method of the volume node.

---

<div class="post-metadata">

### Author: ![giovform](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/giovform/32/4687_2.png) [@giovform](https://discourse.slicer.org/u/giovform)
#### Post date: [September 6, 2019, 7:36pm UTC](https://discourse.slicer.org/t/get-volume-orientation-after-hardening-a-transformation/8326/3 "2019-09-06T19:36:16Z")

</div>

Thank you Andras. Solved my problem.

---

<div class="post-metadata">

### Author: ![Saima](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@Saima](https://discourse.slicer.org/u/Saima)
#### Post date: [October 29, 2019, 4:07am UTC](https://discourse.slicer.org/t/get-volume-orientation-after-hardening-a-transformation/8326/4 "2019-10-29T04:07:51Z")

</div>

Hi andras,  
I used the following on volume node n.  
mRAS=vtk.vtkMatrix4x4();  
n.GetIJKToRASMatrix(mRAS)

I need to get the data of image in world coordinates. How can I do that.

Also, is it possible to align fiducials along the vtk model automatically.

Or if I have fiducials in ijk coordinates how can I convert them into RAS coordinates

---

<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: [October 29, 2019, 12:06pm UTC](https://discourse.slicer.org/t/get-volume-orientation-after-hardening-a-transformation/8326/5 "2019-10-29T12:06:03Z")

</div>

Conversion between voxel (IJK) and world (RAS) are described in the [script repository](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Get_markup_fiducial_RAS_coordinates_from_volume_voxel_coordinates).

Markup fiducial points are placed on visible surfaces and when you drag-and-drop them they remain on surfaces.

If you want to snap to a particular surface then you need to iterate through the points and modify point coordinates to the closest point on the surface. Within days we expect tonhave this feature added to Markups module (or is currently under review).

---

<div class="post-metadata">

### Author: ![aiden.zhu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aiden.zhu/32/67145_2.png) [@aiden.zhu](https://discourse.slicer.org/u/aiden.zhu)
#### Post date: [December 6, 2019, 6:00pm UTC](https://discourse.slicer.org/t/get-volume-orientation-after-hardening-a-transformation/8326/6 "2019-12-06T18:00:38Z")

</div>

Hi Andras,  
I have a silly question for this hardening topic:  
Should I have to (or optionally) remove the observers of a volume node before I do hardening on this volume-node? I mean, you say, we do transform on a volume-node which is associated with a transformed node, right? so when we do the volume-node transform-hardening, the transform-node is still connecting to the volume-node or it is being stopped after the hardening process?

Thanks a lot.

---

<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: [December 6, 2019, 7:48pm UTC](https://discourse.slicer.org/t/get-volume-orientation-after-hardening-a-transformation/8326/7 "2019-12-06T19:48:17Z")

</div>

There is no need to change any observers when the parent transform of an observed volume node changes (due to hardening a transform or for any other reason).
