-
Notifications
You must be signed in to change notification settings - Fork 640
ENH: Add interaction widget axis labels for markups #7975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Usage: m = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLMarkupsFiducialNode') m.AddControlPointWorld(0,0,0) m.SetAxisLabels('X', 'Y', 'Z') m.GetDisplayNode().SetHandlesInteractive(True)
@Sunderlandkyl You may remember that I asked about axis labels for the interaction widgets a while ago, but it was never integrated into Slicer, because it lacked certain functions and then it got forgotten. We needed this functionality with the new interaction widgets you implemented, and I made it work (your quick answer yesterday helped a lot to finish). Can you please take a look and let me know what may be missing for this to be integrated? Here's a video about how it looks: 2024-10-03.15-58-55.mp4It looks good to me, except for one thing. I couldn't get the text properties from the markup to be propagated to the axis labels, see https://github.com/Slicer/Slicer/pull/7975/files#diff-9b4e55420768a6c4ec0e82307c94048f76f2d8e7f278cae12344b4b055badebeR271 (and https://github.com/Slicer/Slicer/pull/7975/files#diff-eb8c3eb226772bfbd7f81c26ca0c10239a7c7260688123bcc49d09a895780964R700, this makes the labels appear, but with constant parameters). Thanks a lot for any feedback! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange that only the color is being applied via text property.
A couple of comments:
- AxisLabels isn't included in WriteXML/ReadXML/CopyContent/PrintSelf.
- Should the AxisLabels be included in the display node instead? (I'm not sure which is the best location).
- Should this PR be expanded to include transform handles as well?
Thanks for the feedback, Kyle! Yes there are some missing pieces for sure, it's good you made note of some of them. It is up for debate where the actual text is stored. I started rebasing the old implementation and for now kept it in the markups node, but it's true that now it could be in the displayable node (subclass of transformable). No problem with moving it there. Do you have any comment about why setting the text property from |
Hi @Sunderlandkyl ! Maybe you haven't seen the last comment as I didn't tag you. Can you please look at that issue why the fonts properties cannot be updated in the function I mention above, if you have a little time? I'd greatly appreciate it as it would be a large step towards integrating it. (We'll decide where to define the strings and other issues later, and I'll make the changes.) Thank you very much! |
I haven't had a chance to look into why the text property isn't updating correctly, and it's not immediately obvious to me from the code what the issue is. I'll need to compile the changes and investigate. |
Thanks @Sunderlandkyl ! This is already useful. OK we'll try to do some more investigation. If you happen to have an idea in the meantime please let us know. |
Usage:
m = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLMarkupsFiducialNode') m.AddControlPointWorld(0,0,0)
m.SetAxisLabels('X', 'Y', 'Z')
m.GetDisplayNode().SetHandlesInteractive(True)