[Insight-users] Problem writing to Analyze file format

Brandon Lin brandon.lin at gmail.com
Sun Jun 15 02:27:12 EDT 2008


Thank you Daniele and Oleksandr.  There is a lot of good information.

I was trying to use the orient image filter to re-orient the images to RPI
direction as suggested by Daniele.  However, I kept getting this exception
druing writer->Update():

ExceptionObject caught !

itk::ExceptionObject (0126F420)
Location: "unknown"
File:
D:\InsightToolkit-3.2.0\Code\BasicFilters\itkPermuteAxesImageFilter.txx
Line: 104
Description: Order indices must not repeat
The code is very simple as below:
    typedef itk::OrientImageFilter<ImageType,ImageType> OrienterType;
     OrienterType::Pointer orienter = OrienterType::New();
     orienter->UseImageDirectionOn();

orienter->SetDesiredCoordinateOrientation(itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RPI);
     orienter->SetInput(reader->GetOutput());
     writer->SetInput( orienter->GetOutput());

   try
   {
    writer->Update();
   }

   catch( itk::ExceptionObject & err)
   {
    std::cerr << "ExceptionObject caught !" << std::endl;
    std::cerr << err << std::endl;
    return EXIT_FAILURE;
   }:

Any ideas?  Any comments or feedback is greatly appreciated.

Regards,
Brandon



On 6/13/08, Daniele Domenichelli <daniele.domenichelli at gmail.com> wrote:
>
> Oleksandr Dzyubak wrote:
> > The only problem is that the Analyze75 header does not have a tag with
> > that info, right?
>
> No, analyze has a tag "orient" (1 byte) but it has only 6 valid values
>
>          0         transverse unflipped
>          1         coronal unflipped
>          2         sagittal unflipped
>          3         transverse flipped
>          4         coronal flipped
>          5         sagittal flipped
>
> Nifti uses quaternion for orientation. See nifti header if you are
> interested:
>
>     http://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1.h
>
>
>
> > The Analyze75 header size is 348 vs 352 for NifTI. Does it mean that
> > those extra bites can hold all the directional info in case of the NIfTI
> > format and well treated by the ITK filters?
>
> No bytes from 349 to 352 are used for extensions.
> Nifti header in not necessarily 352 bytes, it can contain extensions for
> example to contain dicom tags (see nifti header for details)
> Nifti stores informations about orientations of the image in bytes that
> were not used in Analyze
>
>
> > The question is since the Analyze image format has "poor performance" in
> > a sense
> > of the directional info, how does it affect the final results after ITK
> > filters have been used
> > on those images? Do any "info corruptions/changes" squeeze in
> > automatically into
> > the image info tags afterwards since it might be implemented in a filter
> > by some defaults?
>
> I think that the only thing you should take care of when using analyze
> files is that you can't write them in any direction, so you may need to
> reorient the image.
>
> I'm not sure about this anyway, because I mostly use nifti, maybe
> someone else on the mailing list who uses analyze can tell you something
> more...
>
>
> Regards,
> Daniele
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080614/d96f2e1c/attachment.htm>


More information about the Insight-users mailing list