Single markup fiducial event listener

python
#1

Is there any way how to observe events for a single markup fiducial? My goal is to detect a change of fiducial position.

0 Likes

(Steve Pieper) #2

The event includes the index as call data.

You can decorate your python callback with the type, and then you know which control point was being interacted with.

You’ll still get events for any of the points being changed, but you can ignore any you don’t want to process.

@vtk.calldata_type(vtk.VTK_INT)
def callback(node,event,index):
    print(node, object, index)
    
markupNode.AddObserver(slicer.vtkMRMLMarkupsNode.PointModifiedEvent, callback)
1 Like