[Insight-users] TransformMatrix and Position when reading MetaIO files with itkImageFileReader

Torleif Sandnes torleif.sandnes at sintef.no
Wed Jan 16 05:39:11 EST 2008


Hi.

I am using itkImageFileReader to read metaIO files, but it seems that  
the positon and transformation of the files are ignored.
Is this a known problem?
Is there anything I might be doing wrong setting up the  
itkImageFileReader?
Could there be anything wrong with the headerfile?

This is the headerfile

NDims = 3
DimSize = 256 256 180
ElementType = MET_USHORT
ElementSpacing = 1.000000 1.000000 1.000000
TransformMatrix = 0.999999 -0.001688 0.000242 0.001687 0.999986  
0.004929 -0.000251 -0.004929 0.999988
Origin = -0.271393 0.752919 -0.254205
ElementByteOrderMSB = True
ElementDataFile = MR.raw

This is how I read the file:

typedef itk::OrientedImage< unsigned short, 3>  ImageType
itk::ImageFileReader<ImageType> reader =  
itk::ImageFileReader<ImageType>::New();

reader->SetFileName("MR.mha");
try
{
   reader->Update();
}
catch(itk::Exception& e)
{
   //errorhandling
}

Regards,
Torleif Sandnes
Sintef Health Research


More information about the Insight-users mailing list