Linear transform in image plane

Hello everyone,

This question must be trivial to you - but I would very much appreciate any help on this.

Does anybody know how to translate a segmentation in the image plane using the translation sliders?

The only way for me to achieve this is to rotate the segmentation reference frame to the image plane and then use "translation in local (rotated) reference frame’. Problem is then, of course, that the segmentation is rotated…

Screenshot

One option is to make two nested transforms. The outer one rotates to the desired plane, and then the second inner nested one counter rotates by the same amount. Then if you go back to the first and translate in local reference frame you’ll be moving in the rotated plane.

2 Likes

Thanks! Will give this a try as soon as possible.

Works perfectly, here is what I have done according to your input:

Markups → Create a plane in the rotated volume on any image slice.
Then get its orientation in relation to the world coordinate system with:

planeToWorld = vtk.vtkMatrix4x4()
getNode('P').GetObjectToWorldMatrix(planeToWorld)
print(planeToWorld)

Copy the rotation transform (3 x 3 submatrix).

Create first LinearTransform ‘counterRotate’: Paste 3 x 3 submatrix in transform matrix. Press ‘Invert’ button. Apply transform to Segmentation.

Create second LinearTransform ‘rotateAndTranslateWithSliders’: Paste 3 x 3 submatrix in transform matrix. Select translation in local (rotated) coordinate system. Apply transform to transformed segmentation.

Now, as expected, the translation sliders translate the segmentation in the plane of the volume slices. Thank you very much again!

1 Like