Cloning a composite transform yields incorrect result

mikebind
Thu, 02 Oct 2025 23:40:48 +0000
Support

A composite transform node, such as those created by an ANTs QuickSyN registration, is not cloned correctly by the subject hierarchy node. I am using Slicer 5.8.1 on Windows 11. I have been working on taking apart and reassembling composite transforms and initially thought that my code must have errors somewhere, but I have now reproduced the problems without using any of my code.

Steps to reproduce:

1. Add the following composite transform to the scene: https://drive.google.com/file/d/1AH9RWsc5dIsRNxah0p4COLteh7VvCZs_/view?usp=drive_link

2. Load the MRHead image volume from SampleData.

3. Clone the transform (e.g. by right-clicking on it in the subject hierarchy and clicking “Clone”)

4. Alternately soft-apply the original and the cloned transformation to MRHead. Note the visible shifts in the image distortion in the slice views

This particular transform was created using the QuickSyN preset in the “General Registration (ANTs)” module, but it shouldn’t matter how it was created: a cloned MRML node should behave just like the original. I wonder if the problem might arise from the fact that the component transforms of this composite transform are both defined in the inverse (“FromParent”) direction, and maybe something in the cloning isn’t respecting or appreciating that? It looks like the actual copying in CloneSubjectHierarchyItem is done with a call to CopyContent(), which in turn involves a call to DeepCopyTransform in vtkMRMLTransformNode.cxx. I would speculate that the problem is here, but I don’t follow the C++ well enough to pinpoint the issue.

I do regard this as a relatively serious bug. I have never had cause previously to doubt the reliability of cloning a node in Slicer.

7 posts - 4 participants