# RAS coordinates to Image coordinates

**URL:** <https://discourse.slicer.org/t/ras-coordinates-to-image-coordinates/15019>\
**Category:** Development\
**Created:** [December 12, 2020, 5:41pm UTC](https://discourse.slicer.org/t/ras-coordinates-to-image-coordinates/15019 "2020-12-12T17:41:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![justomont](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/justomont/32/16814_2.png) [@justomont](https://discourse.slicer.org/u/justomont)\
**Post date:** [December 12, 2020, 5:41pm UTC](https://discourse.slicer.org/t/ras-coordinates-to-image-coordinates/15019/1 "2020-12-12T17:41:41Z")

</div>

Operating system: macOS Big Sur 11.0.1  
Slicer version: 4.10.1

Dear Developers and Users,

I have a lot of fiducial markup points in the **RAS Coordinates System** , as can be seen in the screen capture, for example **X’5** ➡ **R** : -33.594 **A** : 15.622 **S** : 16.020

I want to obtain their coordinates in the **Image Space** , and associate them with the labels from the volume called **‘aseg’** in the scene (as can be seen in the Data Probe tab). This volume contains the exact area of the brain where each fiducial markup is located.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/6/76adc510a5ccbfa89a556e983e55ac4a8831dca5.jpeg)

Basically, what I need to do is to **automatically** relate the position of all Fiducial Markups with the information of this ‘aseg’ volume. So, for example, the outcome for this point X’5 should be something like:

**X’5: RAS** : [-33.594, 15.622, 16.020] **IMAGE** : [158, 111, 142] **LABEL** : Left-Putamen

Please guide me, I really need some help.  
Best regards.  
Justo

---

<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:** [December 12, 2020, 5:43pm UTC](https://discourse.slicer.org/t/ras-coordinates-to-image-coordinates/15019/2 "2020-12-12T17:43:19Z")

</div>

See the code here that takes into account image geometry and all linear/warping transformations applied to the volume and fiducial list: [https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Get\_volume\_voxel\_coordinates\_from\_markup\_fiducial\_RAS\_coordinates](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Get_volume_voxel_coordinates_from_markup_fiducial_RAS_coordinates)

---

<div class="post-metadata">

**Author:** ![justomont](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/justomont/32/16814_2.png) [@justomont](https://discourse.slicer.org/u/justomont)\
**Post date:** [December 16, 2020, 10:04am UTC](https://discourse.slicer.org/t/ras-coordinates-to-image-coordinates/15019/3 "2020-12-16T10:04:53Z")

</div>

Thanks for your response,

I’ve already tried this approach and the output is a single matrix ([203, 128, 161] in my case). But I don’t know what this result means, as according to the documentation this should be the voxel coordinate of a volume corresponding to a markup fiducial point position. As input, I’ve introduced the complete Markup List (containing 38 Markups), shouldn’t the output be a list too?

Sorry if my question is too ignorant, I’m new to Slicer and Image Transformations.  
Thanks again for helping me.

---

<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:** [December 19, 2020, 6:53am UTC](https://discourse.slicer.org/t/ras-coordinates-to-image-coordinates/15019/4 "2020-12-19T06:53:18Z")

</div>

> [@justomont](#):
>
> I’ve already tried this approach and the output is a single matrix ([203, 128, 161] in my case). But I don’t know what this result means, as according to the documentation this should be the voxel coordinate of a volume corresponding to a markup fiducial point position.

This is correct.

> [@justomont](#):
>
> As input, I’ve introduced the complete Markup List (containing 38 Markups), shouldn’t the output be a list too?

This is the voxel coordinate of a single point. The point index specified in the `markupsIndex` variable.
