# How do you get the slice view your cursor is over?

**URL:** <https://discourse.slicer.org/t/how-do-you-get-the-slice-view-your-cursor-is-over/11542>\
**Category:** Development\
**Created:** [May 14, 2020, 7:14pm UTC](https://discourse.slicer.org/t/how-do-you-get-the-slice-view-your-cursor-is-over/11542 "2020-05-14T19:14:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjg](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mjg](https://discourse.slicer.org/u/mjg)\
**Post date:** [May 14, 2020, 7:14pm UTC](https://discourse.slicer.org/t/how-do-you-get-the-slice-view-your-cursor-is-over/11542/1 "2020-05-14T19:14:26Z")

</div>

Hello,

How do you get the slice view (Red, Yellow, Green) your cursor is over?

Thank you!

---

<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:** [May 14, 2020, 7:34pm UTC](https://discourse.slicer.org/t/how-do-you-get-the-slice-view-your-cursor-is-over/11542/2 "2020-05-14T19:34:40Z")

</div>

Hi - Something like this should work for you:

```auto
c = getNode("*Crosshair*")
c.AddObserver(slicer.vtkMRMLCrosshairNode.CursorPositionModifiedEvent, lambda callee, event: print(c.GetCursorPositionXYZ([0]*3).GetName()))

```

Look in Modules/Scripted/DataProbe/DataProbe.py for more details.

---

<div class="post-metadata">

**Author:** ![mjg](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@mjg](https://discourse.slicer.org/u/mjg)\
**Post date:** [May 14, 2020, 7:51pm UTC](https://discourse.slicer.org/t/how-do-you-get-the-slice-view-your-cursor-is-over/11542/3 "2020-05-14T19:51:17Z")

</div>

Great, thank you so much!
