# Get IJK coordinate

**URL:** <https://discourse.slicer.org/t/get-ijk-coordinate/22650>\
**Category:** Development\
**Created:** [March 23, 2022, 1:00pm UTC](https://discourse.slicer.org/t/get-ijk-coordinate/22650 "2022-03-23T13:00:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haytham](https://avatars.discourse-cdn.com/v4/letter/h/c67d28/32.png) [@Haytham](https://discourse.slicer.org/u/Haytham)\
**Post date:** [March 23, 2022, 1:00pm UTC](https://discourse.slicer.org/t/get-ijk-coordinate/22650/1 "2022-03-23T13:00:05Z")

</div>

Hello,  
how we can get the click coordinate of the mouse in IJK coordinate system? we need to select the segmentation voxel, I am trying to find the relationship between the coordinate system.  
we need the transform matrix between RAS to IJK coordinate system.  
any code c++ can do that?

thanks  
Hayssam

---

<div class="post-metadata">

**Author:** ![Davide\_Scorza](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/davide_scorza/32/70057_2.png) [@Davide\_Scorza](https://discourse.slicer.org/u/Davide_Scorza)\
**Post date:** [March 23, 2022, 1:22pm UTC](https://discourse.slicer.org/t/get-ijk-coordinate/22650/2 "2022-03-23T13:22:33Z")

</div>

Dear Haytham,

Check [this](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#get-volume-voxel-coordinates-from-markup-control-point-ras-coordinates), it should help you.

Cheers

---

<div class="post-metadata">

**Author:** ![Davide\_Scorza](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/davide_scorza/32/70057_2.png) [@Davide\_Scorza](https://discourse.slicer.org/u/Davide_Scorza)\
**Post date:** [March 28, 2022, 9:27am UTC](https://discourse.slicer.org/t/get-ijk-coordinate/22650/4 "2022-03-28T09:27:08Z")

</div>

How are they incorrect?  
I mean, what do you expect, and what are you obtaining?  
Did you compare with what you can read directly in 3D Slicer?

Cheers
