Transform processor module

Hi,

I am trying to decompose a linear transformation into rotation and translation components.
What could be the easiest way to do this please.
I have tried the transform processor module, but I am not sure what are the two input transforms to enter. I only have one, that is generated from model registration. (model A to model b registration, generated linear transform 3). What I m interested is the the angular and translational difference between model a and b separated.

Thanks

Transform processor provides translation vector and orientation matrix. If you need translation magnitude in a single mm value or representation of the total rotation in degrees (or rotation along specific axes) then you need to compute it from the transformation matrix using basic linear algebra. Note that rotation error in itself is often clinically not meaningful, as the error it causes depends on how far the coordinate system is from the region of interest.

If you write more about what exactly you want to evaluate, how the coordinate systems are defined, how transforms are computed between them, etc. then we may be able to give more specific advice.

Thanks @lassoan

This helps

1 Like

I know you aren’t a math professor, but how would one calculate the the translation magnitude or total rotation in degrees from the transformation matrix using linear algebra?

ok. the module works ok. but when its over, and i clear the scene, when the module is opened againg, by script, the 3dslice fails, and finally close
the version i am using is 4.11.20210226 r29738 / 7a593c8

thanks for any suggestion.

ad:
the code i am using is:

def crea_nodo_Transform_Processor(nombre, transfo_in, transfo_out, param):
    transfo_in = slicer.util.getNode(transfo_in)
    transfo_out = slicer.util.getNode(transfo_out)
        
    transfoProcNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLTransformProcessorNode')
    transfoProcNode.SetName(nombre)
    transfoProcNode.SetProcessingMode(transfoProcNode.PROCESSING_MODE_STABILIZE)
    transfoProcNode.SetStabilizationCutOffFrequency(param["filtro_transformada"])
    transfoProcNode.SetAndObserveInputUnstabilizedTransformNode(transfo_in)
    transfoProcNode.SetAndObserveOutputTransformNode(transfo_out)
    transfoProcNode.SetUpdateModeToAuto()

thanks