# Place Fiducial Marker with EndPlacementEvent observer

**URL:** https://discourse.slicer.org/t/place-fiducial-marker-with-endplacementevent-observer/27797
**Category:** Development
**Tags:** markups-fiducials
**Created:** [February 13, 2023, 7:47pm UTC](https://discourse.slicer.org/t/place-fiducial-marker-with-endplacementevent-observer/27797 "2023-02-13T19:47:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![kleingeo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kleingeo/32/6772_2.png) [@kleingeo](https://discourse.slicer.org/u/kleingeo)
#### Post date: [February 13, 2023, 7:47pm UTC](https://discourse.slicer.org/t/place-fiducial-marker-with-endplacementevent-observer/27797/1 "2023-02-13T19:47:58Z")

</div>

I am trying to execute a function after a fiducial marker is placed. I was trying to implement it with this:

```python
def onMarkupEndInteraction(caller, event):
    # Do stuff
    pass

interactionNode = slicer.app.applicationLogic().GetInteractionNode()
selectionNode = slicer.app.applicationLogic().GetSelectionNode()
selectionNode.SetReferenceActivePlaceNodeClassName("vtkMRMLMarkupsFiducialNode")
pointListNode = slicer.mrmlScene.AddNewNodeByClass("vtkMRMLMarkupsFiducialNode")

pointListNode.AddObserver(interactionNode.EndPlacementEvent, onMarkupEndInteraction)
selectionNode.SetActivePlaceNodeID(pointListNode.GetID())
interactionNode.SetCurrentInteractionMode(1)

```

however, it seems to be executing `onMarkupEndInteration` before the fiducial marker is placed. I have been trying many different methods (as there are many different ways to initialize and place fiducial markers), but none seem to properly execute the `observer` for the fiducial marker.

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [February 15, 2023, 5:39am UTC](https://discourse.slicer.org/t/place-fiducial-marker-with-endplacementevent-observer/27797/2 "2023-02-15T05:39:37Z")

</div>

You can observe events of the markups node, such as [slicer.vtkMRMLMarkupsNode.PointPositionDefinedEvent](https://apidocs.slicer.org/master/classvtkMRMLMarkupsNode.html#aceeef8806df28e3807988c38510e56caaf1067cd7bcb1bd0992112b22daf219d5).
