Importing .mha shifts image

I ran into a problem where the image gets shifted when reading it from a .mha file. A part from the image which should be at the right border is shown on the left border. This issue is only with uncompressed .mha. Compressed .mha or .mhd are read correctly.

How to reproduce:

  1. Create Image (File->New->Image…) 400x400, White Background, 1 slice is sufficient.
  2. Draw a cross through the whole image (Place line, then Edit->Draw)
  3. Save image as .mha (File->Save As->MHD/MHA…)
  4. Import image (File->Import->MHD/MHA…)
  5. Observe shifted image (as if it uses the header as image information).

The problem is not with the file, which e.g. in ITK-SNAP opens correctly.

Thanks @acramp, I filed an issue in the relevant issue tracker.

1 Like