[Insight-users] Problem writing to Analyze file format

Daniele Domenichelli daniele.domenichelli at gmail.com
Tue Jun 10 12:56:42 EDT 2008


2008/6/5 Brandon Lin <brandon.lin at gmail.com>:
> If I use AnalyzeImageIO, I got an output window saying "ERROR: Analyze 7.5
> File Format Only Allows RPI, PIR, and RIP Orientation".


Analyze format (as you can read in the error) supports only 3 of the
48 possible orientations of a 3D image. Nifti format supports all of
them.
You can find some useful information about orientation here:

     http://www.insight-journal.org/InsightJournalManager/download_pdf.php?pubid=62_1.pdf
     http://www.wideman-one.com/gw/brain/orientation/orientterms.htm

but pay attention because ITK terminology is exactly the opposite then
the one used in the last document (For example "R" in ITK means that
the origin is in the rightmost point of the image while in this
tutorial means that index increases from left to right)


You can try reorienting the image before writing them by using
OrientImageFilter:


  typedef itk::OrientImageFilter<ImageType,ImageType> OrienterType;
  OrienterType::Pointer orienter = OrienterType::New();
  orienter->UseImageDirectionOn();
  orienter->SetDesiredCoordinateOrientation(itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RPI);
//or your desired orientation
  orienter->SetInput(last_filter->GetOutput());
  writer->SetInput(orienter->GetOutput());


Best Regards,
Daniele


More information about the Insight-users mailing list