# How to get "Transform" matrix in mrinfo

**URL:** https://community.mrtrix.org/t/how-to-get-transform-matrix-in-mrinfo/8367
**Category:** Uncategorized
**Tags:** mrview
**Created:** [May 16, 2025, 6:41am UTC](https://community.mrtrix.org/t/how-to-get-transform-matrix-in-mrinfo/8367 "2025-05-16T06:41:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Hedwig13](https://community.mrtrix.org/user_avatar/community.mrtrix.org/hedwig13/32/5053_2.png) [@Hedwig13](https://community.mrtrix.org/u/Hedwig13)
#### Post date: [May 16, 2025, 6:41am UTC](https://community.mrtrix.org/t/how-to-get-transform-matrix-in-mrinfo/8367/1 "2025-05-16T06:41:14Z")

</div>

Hi there, could you please tell me which tag to get this `transform` matrix? or how to calculate it?

 ![image](https://community.mrtrix.org/uploads/default/original/2X/4/4bd3581cbc196cb626f8e2a08bbc3b0c8d3df6f7.png)

Here is some tag information might be useful:  
Image Orientation [0020, 0037] 1, -0, 0/0, 1, -0  
Pixel Spacing [0028, 0030] 1.8/1.8  
Image Position [0020, 0032] -118.179626, -114.364075, 505.625275  
Slice Thickness [0018, 0050] 3.0  
Frame of Reference UID [0020, 0052] 1.2.276.0.7230010.3.1.3.3521924742.13500.1740017298.13448242

But I have no idea how to get (-110.4, -114.2, 439.6), could you please give me some advice? great appreciate!

---

<div class="post-metadata">

### Author: ![Hedwig13](https://community.mrtrix.org/user_avatar/community.mrtrix.org/hedwig13/32/5053_2.png) [@Hedwig13](https://community.mrtrix.org/u/Hedwig13)
#### Post date: [May 19, 2025, 2:22am UTC](https://community.mrtrix.org/t/how-to-get-transform-matrix-in-mrinfo/8367/2 "2025-05-19T02:22:08Z")

</div>

I seems figure out this problem, because for one MIF/NII, there is only one image position tag, but for DICOM SERIES, each different dcm file contains unique image position tag. Which can cause some difference?  
My problem is, when I tried to define a ROI file from VTK and save as nii.gz file, and load it in `mrview` or use the ROI file for `tckgen`, and no proper result is generated or displayed.  
Seems I need to solve the `origin` problem to get the correct result.

---

<div class="post-metadata">

### Author: ![Hedwig13](https://community.mrtrix.org/user_avatar/community.mrtrix.org/hedwig13/32/5053_2.png) [@Hedwig13](https://community.mrtrix.org/u/Hedwig13)
#### Post date: [May 20, 2025, 12:55am UTC](https://community.mrtrix.org/t/how-to-get-transform-matrix-in-mrinfo/8367/3 "2025-05-20T00:55:40Z")

</div>

I read the metadata from ITK-SNAP and here is the `origin` point information:

 ![image](https://community.mrtrix.org/uploads/default/original/2X/a/acb5b9ce788d93225a0eb3cc346e24bfebad7980.png)  
and here is from `mrinfo` gets `transform` like this, I have no idea how to get the data:  
 ![image](https://community.mrtrix.org/uploads/default/original/2X/1/1a39fbf3bdfe8c2391f8f433fb9a0f7f9d3a6782.png)  
But I use ITK instead of DCMTK and VTK to save my-defined ROI and rewrite other parameters, and finally get the same (-110, -114, 439) transform matrix.
