Hello.
I would like to display transformation fields and manipulate some visualization features of the fields such as spacing, scale factor. I tried writing a program to do that based on this document but it does not work.
Below is my code:
#get a field node
field = getNode(“Transform_field”)
get the transforms widget
displacement_widget = slicer.qMRMLTransformDisplayNodeWidget()
displacement_widget.setMRMLTransformNode(field)
displacement_widget.setVisibility(True)
displacement_widget.setVisibility2d(True)
#set spacing and scale factors
displacement_widget.setGlyphSpacingMm(3)
displacement_widget.setGlyphScalePercent(250)
I realized that when I check and uncheck the “visible” or “visible in slice view” checkbox inside visualization section, my program works. It would be great if you could correct my code.
Thank you.