# Quick Q for RemoveObserver

**URL:** https://discourse.slicer.org/t/quick-q-for-removeobserver/28354
**Category:** Support
**Tags:** python
**Created:** [March 13, 2023, 6:33pm UTC](https://discourse.slicer.org/t/quick-q-for-removeobserver/28354 "2023-03-13T18:33:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![aiden.zhu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aiden.zhu/32/67145_2.png) [@aiden.zhu](https://discourse.slicer.org/u/aiden.zhu)
#### Post date: [March 13, 2023, 6:33pm UTC](https://discourse.slicer.org/t/quick-q-for-removeobserver/28354/1 "2023-03-13T18:33:13Z")

</div>

Hi all,  
quick question about “RemoveObserver”==\>  
After I did the following to add one observer  
“”"  
crosshairNode=slicer.util.getNode(“Crosshair”)  
crosshairNode.AddObserver(slicer.vtkMRMLCrosshairNode.CursorPositionModifiedEvent, self.onMouseMoved)  
“”"  
I did try  
crosshairNode.RemoveObserver(slicer.vtkMRMLCrosshairNode.CursorPositionModifiedEvent)  
but no effect from this line.

how to remove the observer?

---

<div class="post-metadata">

### Author: ![smrolfe](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/smrolfe/32/3659_2.png) [@smrolfe](https://discourse.slicer.org/u/smrolfe)
#### Post date: [March 13, 2023, 7:46pm UTC](https://discourse.slicer.org/t/quick-q-for-removeobserver/28354/2 "2023-03-13T19:46:44Z")

</div>

You can remove an observer using the tag generated when the observer was added. See the [this example](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#display-mouse-pointer-coordinates-in-alternative-coordinate-system) in the script repository.

---

<div class="post-metadata">

### Author: ![aiden.zhu](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aiden.zhu/32/67145_2.png) [@aiden.zhu](https://discourse.slicer.org/u/aiden.zhu)
#### Post date: [March 13, 2023, 8:08pm UTC](https://discourse.slicer.org/t/quick-q-for-removeobserver/28354/3 "2023-03-13T20:08:39Z")

</div>

Thanks a lot for the solution.  
It worked after taking all parameters to the root “self”.
