Operating system: win10 64 20H2
Slicer version: 4.11.20200930
Expected behavior: get the transform edited in 3D views interactively in Python Interacter
Actual behavior:
I am trying to automate my segmentation process using Python Interacter, but sometimes still needs manual opreation. After the ROI drawing, i need to rotate the segmentation label, so i create a new transformnode and link it to the segmentation node. But i can not find a way to get the transform edited in 3D views interactively, as the “interation in 3d view” function do in the GUI. The following is the code patch:
Hi, I used your code, then edited the transform interactively, and then printed the edited transformation matrix with this code in the python interactor: print(transformNode.GetMatrixTransformToParent())
The printed transform matrix was the same as what I see in the Transforms module. So I guess you can use “transformNode” to get the results of your interactions.
Thank you very much for you reply. What i need is to get a boundary or bounding box of my segmentation in 3D view window and then to drag or rotate the segmentation boundary to modify the position of my segmentation. This can be achieved in the GUI as this post did:
However i still fail to emulate this “interaction in 3d view” action. I thought i need to access the qSlicerSubjectHierarchyTransformsPlugin object, but i fail to access it using slicer.qSlicerSubjectHierarchyTransformsPlugin().toggleInteractionBox.
I also failed to emulate it trying to using the code inside the “toggleInteractionBox” function.
to show the interactive controls (setting visibility to False would hide them). I think that’s what you were looking for, if not, please clarify and ask again.