How to access Node in Scene?

In nodeAddedCallback you will “get notified” about new vtkMRMLMarkupsFiducialNode nodes. Every time a new of these nodes is added, you can add an observer to that node for observing the addition of new control points on that node. Something on the lines of:

markupFiducialNode.AddObserver(self.markupsFiducialNode.PointPositionDefinedEvent,
self.onControlPointAdded)

Then again onControlPointAdded should also be a callback function that will react to the addition of a control point to the fiducial markup.

If you think that only one vtkMRMLMarkupsFiducialNode will be used, you can generate it during initialization of your module yourself and you can save the first callback.

1 Like