[Insight-developers] about the Analyze image origin reading

Zhijun Zhang zjzhang at ee.cuhk.edu.hk
Sun Oct 2 11:25:46 EDT 2005


Dear all:

         I want to read an Analyze Image data with itkAnalyzeImageIO reader, 
in my
image, the image origin is set to a non zero 3D point by using MRIcro 
software, however,
after I read the data and check with Print(std::cout), the origin is 
(0,0,0); so what's the problem?
Here is the code I used:

  const unsigned int Dimension = 3;
  typedef unsigned short PixelType;
  typedef itk::Image< PixelType, Dimension >  FixedImageType;
  typedef itk::Image< PixelType, Dimension >  MovingImageType;
  typedef itk::ImageFileReader< FixedImageType  > FixedImageReaderType;
  typedef itk::ImageFileReader< MovingImageType > MovingImageReaderType;
  FixedImageReaderType::Pointer fixedImageReader   = 
FixedImageReaderType::New();
  MovingImageReaderType::Pointer movingImageReader = 
MovingImageReaderType::New();
  typedef itk::AnalyzeImageIO   ImageIOType;
  ImageIOType::Pointer  imageIO = ImageIOType::New();
  fixedImageReader->SetImageIO(imageIO);
  fixedImageReader->SetFileName( SourceFile );
  movingImageReader->SetImageIO(imageIO2);
  movingImageReader->SetFileName( TargetFile );
  fixedImageReader->Update();
  movingImageReader->Update();
  fixedImageReader->GetOutput()->Print(std::cout);
  movingImageReader->GetOutput()->Print(std::cout);


regards,
Alex




More information about the Insight-developers mailing list