Markups Plane rotation

Hello,
is it possible to rotate a markups plane around its axes?

best regards
Ladislav

Hello @soukup.la. Yes, it is possible. If you right-click in one of the plane points you can enable the rotations in the Interaction options --> Rotate option.

Great! Is it possible to make it somehow using Python code?

I guess you can always retrieve the points of the plane, do the transforms you need to them and set the new coordinates to the plane markup in Python. I’m not sure on whether the functionality of the rotation widget is exposed in Python for an easier solutio. Perhaps @Sunderlandkyl knows about this?

Yeah, you can enable the rotation handles with SetRotationHandleVisibility:

planeNode.GetDisplayNode().SetRotationHandleVisibility(True)

I think @soukup.la probably meant to do the rotation directly in python without the markups widgets? Are there any functions in the logic driving these rotations? Thanks for the quick reaction @Sunderlandkyl

1 Like

No, there isn’t a logic function for calculating those rotations.

The easiest might be to get the axes with vtkMRMLMarkupsPlaneNode::GetAxes/GetAxesWorld and then use vtkTransform::RotateWXYZ to calculate the rotation around a specific axis.

After that you can just apply the transform with planeNode.ApplyTransform().

1 Like

Thank you very much!

1 Like