Hi there,
I am currently facing a problem while writing segmentations as .mhd files. I am using a Subversion version of MITK (Revision 29842; the latest in the old Subversion Repository) together with ITK 3.20.0. When I am loading an .mhd dataset with the following header information:
ObjectType = Image
NDims = 3
BinaryData = True
BinaryDataByteOrderMSB = False
CompressedData = False
TransformMatrix = 1 0 0 0 1 0 0 0 1
Offset = 31.395 21.252 16.65
CenterOfRotation = 0 0 0
AnatomicalOrientation = RAI
ElementSpacing = 0.483 0.483 0.49
DimSize = 223 211 122
ElementType = MET_UCHAR
ElementDataFile = MyFilename.raw
And save it again as a .mhd file, I am getting the following header
information:
ObjectType = Image
NDims = 3
BinaryData = True
BinaryDataByteOrderMSB = False
CompressedData = False
TransformMatrix = 107.709 0 0 0 101.913 0 0 0 59.78 Offset = 31.395 21.252 16.65 CenterOfRotation = 0 0 0 AnatomicalOrientation = RAI ElementSpacing = 0.483 0.483 0.49 DimSize = 223 211 122 ElementType = MET_FLOAT ElementDataFile = MyFilename2.raw
Please note the difference in the TransformMatrix line. For some reason the writing with my current MITK QT4 version adds some rotation which is not in the data. The old QT3 version did not do that.
From my testing, I can say that:
- writing the .mhd file adds this arbitrary transformation
- this transformation is not visible in the "details" view in the Datamanager (there, only the scaling values are visible)
- this transformation is not being read or used by both the old QT3 and the new QT4 MITK version when loading the newly written dataset (both, the new and the original one are at the same location and orientation)
I am guessing that this is error is either related to MITK (handing some transformation to the .mhd file writer which is not actually present) or to ITK who are now writing transformations to the .mhd files which they didn't in version 3.16.0 that I have used with MITK QT3 before. Anyway MITK should cause the file writer to write the identity matrix in my case.
Could you please try to reproduce this error with your current MITK version?
Thank you very much,
Matthias
Dipl.-Ing. Matthias Keil