Skip to content

BUG: Fixed composite transform problems

By hardening a non-linear transform on a vtkMRMLLinearTransformNode makes the contents of the linear transform node non-linear. This causes errors in many places in the code where linearity of the transform is tested by checking the class type instead of calling transform->IsLinear() or transform->IsTransformToParentLinear().

In the long term all specific transform nodes (linear, bspline, grid) should be removed and only the generic vtkMRMLTransformNode should be used everywhere. The specific classes are already “empty”, they do not contain any useful functionality, but they are be used in extensions (and still have not removed from everywhere in the Slicer core), so they have to be phased out gradually.

Specific problems: • If affine transform is applied to bspline then bspline component is ignored • If affine transform is applied to bspline and affine is hardened then the bspline component is lost. • Hardening multiple nonlinear transforms on a transform sometimes results in incorrect composite transform

Fixes: • Instead of casting to vtkMRMLLinearTransform IsLinear or IsTransformToWorldLinear has to be called to decide if a transform is linear (checking the class type does not work correctly for composite transforms) • Fixed vtkMRMLTransformNode::ApplyTransform • Moved full implementation of get/set transform matrix functions in vtkMRMLTransformNode (it further prepares removal of obsolete linear/bspline/grid transform node classes)

Enhancements: • Allow splitting of composite transforms to its components (Transforms module: Split button – only displayed for composite transforms)

Merge request reports