I used python script to use the landmark registration plugin and applied a custom transformation matrix like following:
transformed_node = slicer.util.getNode(“Transform”)
Now as denoted in the picture, the transformation works perfectly on the red circled area. However, I want to also apply in green cirlced area. Which is the “Moving” volume. How can I achieve that?
I can grab all the volume node by using
for sliceViewName in layoutManager.sliceViewNames(): ... view = layoutManager.sliceWidget(sliceViewName).sliceView() ... sliceNode = view.mrmlSliceNode() ... sliceLogic = slicer.app.applicationLogic().GetSliceLogic(sliceNode) ... compositeNode = sliceLogic.GetSliceCompositeNode() ... print('Slice view ' + str(sliceViewName)) ... print(' Name: ' + sliceNode.GetName()) ... print(' ID: ' + sliceNode.GetID())
When I try to apply a tranform matrix on one of nodes in the green area, I got bellow error:
AttributeError: 'MRMLCorePython.vtkMRMLSliceNode' object has no attribute 'SetMatrixTransformToParent'
So, My question is how I can apply then change in the green area, which is seen in the read area using the same transformation matrix?