# Apply and save a transformation on an mha file

**URL:** <https://discourse.slicer.org/t/apply-and-save-a-transformation-on-an-mha-file/26499>\
**Category:** Support\
**Tags:** registration\
**Created:** [November 29, 2022, 7:38pm UTC](https://discourse.slicer.org/t/apply-and-save-a-transformation-on-an-mha-file/26499 "2022-11-29T19:38:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rggelel](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rggelel/32/17508_2.png) [@rggelel](https://discourse.slicer.org/u/rggelel)\
**Post date:** [November 29, 2022, 7:38pm UTC](https://discourse.slicer.org/t/apply-and-save-a-transformation-on-an-mha-file/26499/1 "2022-11-29T19:38:20Z")

</div>

Hello everyone,  
I have a question about the mha file. I have an mha file that has a basic transform written in the file. But, I would like to change this transform with another one and save it in the file. Do you know a way to do this and even automate it afterwards? Thanks for your help.

---

<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 1, 2022, 6:00am UTC](https://discourse.slicer.org/t/apply-and-save-a-transformation-on-an-mha-file/26499/2 "2022-12-01T06:00:52Z")

</div>

You can [load the image file as a volume node](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#load-volume-from-file), set the IJK to RAS matrix (origin, spacing, axis directions) by calling methods on the volume node, and then [save the volume node](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#save-volume-to-file).
