# Single markup fiducial event listener

**URL:** <https://discourse.slicer.org/t/single-markup-fiducial-event-listener/6455>\
**Category:** Development\
**Tags:** python\
**Created:** [April 10, 2019, 8:11pm UTC](https://discourse.slicer.org/t/single-markup-fiducial-event-listener/6455 "2019-04-10T20:11:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![michalikthomas](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@michalikthomas](https://discourse.slicer.org/u/michalikthomas)\
**Post date:** [April 10, 2019, 8:11pm UTC](https://discourse.slicer.org/t/single-markup-fiducial-event-listener/6455/1 "2019-04-10T20:11:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [April 11, 2019, 8:03pm UTC](https://discourse.slicer.org/t/single-markup-fiducial-event-listener/6455/2 "2019-04-11T20:03:23Z")

</div>

The event includes the index [as call data](https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Markups/MRML/vtkMRMLMarkupsNode.h#L190).

You can [decorate your python callback](https://www.slicer.org/wiki/Documentation/Nightly/Developers/FAQ#How_can_I_access_callData_argument_in_a_VTK_object_observer_callback_function) 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.

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

```
