Hi,

I want to set and apply a transformation matrix using Python.

Here is my code:

`transform = slicer.vtkMRMLTransformNode() transform.SetName('Transformation') slicer.mrmlScene.AddNode(transform) matrix = vtk.vtkMatrix4x4() matrix.SetElement(0, 0, 0.67) matrix.SetElement(0, 1, 0.45) matrix.SetElement(0, 2, 1) matrix.SetElement(0, 3, 23) matrix.SetElement(1, 0, 0.34) matrix.SetElement(1, 1, 1) matrix.SetElement(1, 2, 0) matrix.SetElement(1, 3, -11) matrix.SetElement(2, 0, 0.5) matrix.SetElement(2, 1, 0.1) matrix.SetElement(2, 2, 1) matrix.SetElement(2, 3, -33) matrix.SetElement(3, 0, 0) matrix.SetElement(3, 1, 0) matrix.SetElement(3, 2, 0) matrix.SetElement(3, 3, 1) transform.SetMatrixTransformFromParent(matrix) model = slicer.util.getNode('model') model.SetAndObserveTransformNodeID(transform.GetName()) model.SetAndObserveTransformNodeID(transform.GetID())`

Unfortunately, I get some strange results when I check the output at Transformation module, why that is happening and what am I doing wrong here?

Thanks