# Retrieving Transform Matrix From Transforms Module

**URL:** <https://discourse.slicer.org/t/retrieving-transform-matrix-from-transforms-module/14924>\
**Category:** Support\
**Tags:** transforms\
**Created:** [December 7, 2020, 10:26am UTC](https://discourse.slicer.org/t/retrieving-transform-matrix-from-transforms-module/14924 "2020-12-07T10:26:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![YBurakD](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/yburakd/32/9105_2.png) [@YBurakD](https://discourse.slicer.org/u/YBurakD)\
**Post date:** [December 7, 2020, 10:26am UTC](https://discourse.slicer.org/t/retrieving-transform-matrix-from-transforms-module/14924/1 "2020-12-07T10:26:18Z")

</div>

Hi,

I have 3D images that I need to rotate and to do this I am using the transforms module. I want to do the rotation in the gui with sliders and retrieve the transform matrix via python code to apply the transform with ITK later. However, in transform node I couldn’t find any function that returns this information. Is there any way to get the transform matrix?  
Here is the code I use to create transform node and visualize the transform

```
        slicer.util.mainWindow().moduleSelector().selectModule('Transforms')
        transformNode = slicer.vtkMRMLTransformNode()
        slicer.mrmlScene.AddNode(transformNode)
        
        volumeNode = slicer.util.loadVolume(filePath)
        volRenLogic = slicer.modules.volumerendering.logic()
        
        #Display the volume
        displayNode = volRenLogic.CreateDefaultVolumeRenderingNodes(volumeNode)
        displayNode.SetVisibility(True)
        
        #Center 3d Volume
        layoutManager = slicer.app.layoutManager()
        threeDWidget = layoutManager.threeDWidget(0)
        threeDView = threeDWidget.threeDView()
        threeDView.resetFocalPoint()
        
        volumeNode.SetAndObserveTransformNodeID(transformNode.GetID())
```

---

<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 7, 2020, 10:15pm UTC](https://discourse.slicer.org/t/retrieving-transform-matrix-from-transforms-module/14924/2 "2020-12-07T22:15:44Z")

</div>

Transform’s module developer documentation should answer all the above questions: [https://www.slicer.org/wiki/Documentation/Nightly/Modules/Transforms#Information\_for\_Developers](https://www.slicer.org/wiki/Documentation/Nightly/Modules/Transforms#Information_for_Developers)

Let us know if you have any remaining questions.
