# Get the slice view under the mouse cursor

**URL:** <https://discourse.slicer.org/t/get-the-slice-view-under-the-mouse-cursor/37501>\
**Category:** Development\
**Created:** [July 22, 2024, 1:59pm UTC](https://discourse.slicer.org/t/get-the-slice-view-under-the-mouse-cursor/37501 "2024-07-22T13:59:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohithck](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rohithck/32/77403_2.png) [@rohithck](https://discourse.slicer.org/u/rohithck)\
**Post date:** [July 22, 2024, 1:59pm UTC](https://discourse.slicer.org/t/get-the-slice-view-under-the-mouse-cursor/37501/1 "2024-07-22T13:59:13Z")

</div>

Hello slicer developers,  
How to get the slice view (Red, Green or Yellow) under the mouse cursor in Python, like what shown in Data Probe module (Eg: Green in the image)?

And also how to get the plane coordinates (or plane equation) of the current slice view, so that i can set the plane to that slice view later when a button is clicked.

![Screenshot from 2024-07-21 11-39-51](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/8/88871b4d3b466dfe228b5b8d81d3eb473cc0299f.png)

---

<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:** [July 22, 2024, 9:12pm UTC](https://discourse.slicer.org/t/get-the-slice-view-under-the-mouse-cursor/37501/2 "2024-07-22T21:12:08Z")

</div>

See examples in the [script repository](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#get-current-mouse-coordinates-in-a-slice-view). You can get the slice normal from the [SliceToRAS](https://apidocs.slicer.org/master/classvtkMRMLSliceNode.html#a888f4614c00f350f4440ac9bde8a3a6d) homogeneous transformation matrix (slice normal in the RAS coordinate system is the third column of the matrix).
