# Screen position from RAS coordinates

**URL:** <https://discourse.slicer.org/t/screen-position-from-ras-coordinates/30055>\
**Category:** Development\
**Tags:** segmentation, python\
**Created:** [June 15, 2023, 3:31pm UTC](https://discourse.slicer.org/t/screen-position-from-ras-coordinates/30055 "2023-06-15T15:31:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pearsonm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pearsonm/32/18514_2.png) [@pearsonm](https://discourse.slicer.org/u/pearsonm)\
**Post date:** [June 15, 2023, 3:31pm UTC](https://discourse.slicer.org/t/screen-position-from-ras-coordinates/30055/1 "2023-06-15T15:31:54Z")

</div>

slicer.util.clickAndDrag() includes a code snippet that uses an interactor to show the screen position on left mouse click. Is there a way to get the screen position from RAS coordinates in the Red slice? I want to import ROIs from another program and draw them in slicer with simulated mouse clicks.

---

<div class="post-metadata">

**Author:** ![pearsonm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pearsonm/32/18514_2.png) [@pearsonm](https://discourse.slicer.org/u/pearsonm)\
**Post date:** [June 16, 2023, 1:59am UTC](https://discourse.slicer.org/t/screen-position-from-ras-coordinates/30055/2 "2023-06-16T01:59:39Z")

</div>

I found [rasToDisplay](https://github.com/Slicer/Slicer/blob/c3d74d68839078ec02b1053d4ba413643e84630c/Modules/Loadable/Markups/Testing/Python/NeurosurgicalPlanningTutorialMarkupsSelfTest.py#L111) which does what I want.
