Slicer/itkMGHImageIO — pull request #3 by Chaircrusher (2013-09-20 21:10:09+00:00)
Title: BUG: missing steps converting origin back to freesurfer space

This was a bug identified by Eun Young Kim eunyoung-kim@uiowa.edu

If you read in an MGZ file, and then subsequently wrote out an MGZ file, the origin gets changed.

In fact I'd say if you read in an image in any ITK-supported format, and wrote it out as an MGZ file, then the origin will be wrong.

The problem was (I believe) in forgetting to reverse the sign of the X & Y components of the origin before writing. I changed the code in WriteHeader so that it would match the code in ReadHeader.