# How to access Node in Scene?

**URL:** https://discourse.slicer.org/t/how-to-access-node-in-scene/27197
**Category:** Development
**Tags:** segmentation, python, extensions
**Created:** [January 12, 2023, 2:16am UTC](https://discourse.slicer.org/t/how-to-access-node-in-scene/27197 "2023-01-12T02:16:17Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)
#### Post date: [January 13, 2023, 4:20pm UTC](https://discourse.slicer.org/t/how-to-access-node-in-scene/27197/5 "2023-01-13T16:20:34Z")

</div>

Hello again,

If I understand your problem correctly, you are probably not interested in the mouse click itself, you are interested to know when a new markups control point is placed (and yes, usually this comes after a mouse click, but it could also come from a python command). Therefore, I think you should focus on the event of adding a new control point.

If your design only requires to have one `vtkMRMLMarkupsFiducialNode` with several control points, I would create one in my code during initialization, and observe

```auto
# This should go in your logic initialization and should be called only
# once
self.markupsFiducialNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLMarkupsFiducialNode')
self.markupFiducialNode.AddObserver(self.markupsFiducialNode.PointPositionDefinedEvent, self.onControlPointAdded)

```

`self.onControlPointAdded` is a callback function that will be called every time a new control point on `self.markupsFiducialNode` is added. The callback function will have some parameters that will help you get all the information about the node and the control points. There is more information about this mechanism in: [Handle Markups events from an external module - #28 by Fangwen\_Zhai](https://discourse.slicer.org/t/handle-markups-events-from-an-external-module/6332/28)

I hope this works for you.

---

_[View the full topic](https://discourse.slicer.org/t/how-to-access-node-in-scene/27197)._
