Image with hardened transform returns to original when opened outside Slicer

Operating system: Windows 10
Slicer version: 4.6.2
Expected behaviour: After hardening transform, saved image volume will preserve transformed state when opened outside Slicer
Actual behaviour: Image returns to original (un-transformed) orientation when opened outside Slicer


I am trying to perform a simple rotation transformation to a .mha volume and then save the transformed result to be available outside of Slicer; however, when I open the saved result outside of Slicer, the image returns to its original orientation.

I have hardened the transform before saving and I have also tried using “Resample Scalar Volume” on the transformed image but it both cases the image returns to its original orientation when opened in a variety of programs (ex. VolView, MATLAB,…) outside of Slicer. It should be noted that when the saved volumes are re-opened in Slicer, the transform is applied. Additionally, the transform does appear in the .mha TransformMatrix header field.

I also tried exporting the transformed/resampled images as DICOM series, in case it was an incompatibility with the .mha format but this had the same un-transformed result outside of Slicer. I also tried all options with the “Ignore Orientation” option selected and deselected on data import (suggestion found from a similar question from 2012 online:

I appreciate any help you can offer and thank you!


Summary of approaches tried:
Hardening transform and saving as .mha and DICOM
Resampling transformed image and saving as .mha and DICOM
Import data with/without “Ignore Orientation” option selected and repeating 2 items above

1 Like

Hi Jessica -

If the external program (e.g. matlab) is ignoring the transformmatrix field of the metaheader then what you are seeing is expected behavior for the harden step.

Instead of Resample Scalar Volume, which only changes the pixel data, you can use Resample Image (BRAINS) which allows you to set the input image, the transform, and a reference image that defines the output pixel grid that you want. Then the pixel matrix should work in matlab.

Hope that helps,


Thanks so much, Steve! This solved the problem for me!

P.S. Do you know why this one is called BRAINS!? (Doesn’t seem like an intuitive place to look!)

Thank you!

Good point - the BRAINSTools are provided by our colleagues so we keep the name, but I can see how it’s confusing!

I found it very confusing, too. The project indeed started off as a collection of tools for brain images, but over time it has become a generic toolkit. The name was kept for preserving “brand” identity.