# About screen coordinates

**URL:** https://discourse.slicer.org/t/about-screen-coordinates/23662
**Category:** Support
**Created:** [June 1, 2022, 1:26am UTC](https://discourse.slicer.org/t/about-screen-coordinates/23662 "2022-06-01T01:26:50Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Changing](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@Changing](https://discourse.slicer.org/u/Changing)
#### Post date: [June 1, 2022, 1:26am UTC](https://discourse.slicer.org/t/about-screen-coordinates/23662/1 "2022-06-01T01:26:50Z")

</div>

Hello. Through the screenshot function of 3D slicer, I extracted an image from the green view. The shape of the extracted image is 634\*441. The extracted image is displayed by opencv.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/c/5ca532c8e1cfd35da2d2fc415f6f855768e4e23b.png)

The shape of the volume input to the 3D slicer is 240×240×208. Now I place markers in the green view of the 3D slicer as shown. And the IJK coordinates of the marker point is (134, 120, 143)  
 ![Screenshot](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/8/b8a223b5d079dcbdb92bb9f76f7eedfb23152df4.png)

 ![1654006187(1)](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/7/b70d24d1b280018919b5c87238bdc2308f91c04f.png)

The problem is: When I convert the size and scale, the position of the marker points I draw in opencv is not the same as the position marked in the 3D slicer. The position of the marker point drawn in opencv is shown in the figure.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/5/a5184d8f51b9ba6a9ec3ec437769fa71e85215ba.png)

My coordinate conversion process is as follows：  
x = 634-(634×134/240)  
y = 441-(441×163/208)  
Is there something wrong with my coordinate conversion? I feel that there is no problem with the x coordinate, but there is a problem with the y coordinate. How can I fix this my problem.

And I found that the out of frame prompt appeared when I placed the marker F-3, what is the reason for this?

 ![1654006877(1)](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/b/1ba6012563a75644f7807686dc88e5dd1439824f.png)

---

<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: [June 1, 2022, 2:12pm UTC](https://discourse.slicer.org/t/about-screen-coordinates/23662/2 "2022-06-01T14:12:09Z")

</div>

> [@Changing](#):
>
> screenshot function

Taking a screenshot means that the pixels have been scaled and translated by the view parameters. You can learn the transformation back to source pixel space (see how it is done in the DataProbe source code) but it’s going to be awkward. You’d be better off working with the image data as numpy arrays directly. See the script repository for examples.
