[slicer-users] Syncing widgets with MRML scene
ali.uneri at jhu.edu
Fri Mar 19 14:40:03 EDT 2010
This mail-list has been very helpful in the past, and I'm in need of help
I'm having a problem with my Slicer Interactive module in Python. I've
created a vtkSlicerNodeSelectorWidget and I want the nodes to be in sync
with my MRMLScene, i.e. if the nodes are of type vtkMRMLFiducialListNode, I
would like to see them in my widget just as in the Fiducials Module. Below
is how I currently instantiate my widget:
from Slicer import slicer
self.my_selector = slicer.vtkSlicerNodeSelectorWidget()
self.my_selector.SetNodeClass('vtkMRMLFiducialListNode', 0, 0, 0)
slicer.TkCall('pack %s -side top -fill x -padx 5 -pady 5' %
In the C++ version, .SetMRMLScene() was enough to establish a link between
the widget and the scene, however this is not the case in Python. Do I need
to handle an event, or update something periodically to ensure that my
selector widget displays the correct nodes in the current scene.
I also noticed there are multiple ways to obtain a scene, i.e.
self.GetLogic().GetMRMLScene(), what is the preferred way of getting the
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the slicer-users