# BUG when reading mha file with AnatomicalOrientation

**URL:** <https://discourse.slicer.org/t/bug-when-reading-mha-file-with-anatomicalorientation/7038>\
**Category:** Development\
**Tags:** file-export, file-import\
**Created:** [June 5, 2019, 4:15pm UTC](https://discourse.slicer.org/t/bug-when-reading-mha-file-with-anatomicalorientation/7038 "2019-06-05T16:15:35Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![agirault](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/agirault/32/74_2.png) [@agirault](https://discourse.slicer.org/u/agirault)\
**Post date:** [June 6, 2019, 6:58pm UTC](https://discourse.slicer.org/t/bug-when-reading-mha-file-with-anatomicalorientation/7038/6 "2019-06-06T18:58:01Z")

</div>

> [@Import mhd data](https://discourse.slicer.org/t/import-mhd-data/3389/2):
>
> > Does the **TransformationMatrix** specify rotation between (i,j,k) and the RAS coordinate?
> 
> Yes.

@lassoan in the other thread linked above, you mention that the TransforMatrix (is that different from the Orientation field?) is a rotation from ijk to RAS. However, when saved as a NRRD, the transformation matrix is the same, but in LPS, as shown above. So either:

1. the actual transform is IJKtoRAS but IJKtoLPS
2. is is IJKtoRAS but we read it as IJKtoLPS

Would you agree?

Also, I’m currently updating those readers & writers in VTK. What do you suggest I do for MetaIO?

1. Same as NRRD (use the AnatomicalOrientation as the target coordinate system)
2. enforce as LPS (do nothing)
3. enforce as RAS (flip I and J)

---

_[View the full topic](https://discourse.slicer.org/t/bug-when-reading-mha-file-with-anatomicalorientation/7038)._
