[Insight-developers] experiences with writing Analyze and MetaIO images and orientation with ITK 3.2.0

Hans J. Johnson hans-johnson at uiowa.edu
Wed Sep 5 08:25:15 EDT 2007


Kris,

I wanted to add a bit of clarification to your statements about the
Analyze7.5 reader.  The Analyze 7.5 reader implementation in ITK was one of
the first image file readers that was committed even before ITK had the
concept of orientation.  As such the original developers of the Analyze75 IO
(my colleagues and I at Iowa) were lax in the original implementation, and
now we are stuck with maintaining backwards compatibility with a sub-optimal
solution.  

Analyze 7.5 in ITK only records 3 of the 48 possible orthogonal orientations
of a 3D image properly.  The other 45 orientations are all lumped into the
CORONAL orientation.

It is very easy to get right left swapping in medical images, so be very
careful when using Analyze75 because it will often write improperly oriented
images.  There is a compile-time #define to force Analyze75 to throw an
error when orientation is not going to be written properly, I would suggest
using that if you are working on medical image processing.

In our lab, we could not afford R/L swapping errors, and have moved
completely over to the NIFTI file format.   It supports orientation much
more consistently.

I hope these comments help.

Hans

-- 
Hans J. Johnson, Ph.D.
Hans-johnson at uiowa.edu

278 GH
The University of Iowa
Iowa City, IA 52241
(319) 353 8587


> From: Kris Thielemans <kris.thielemans at csc.mrc.ac.uk>
> Date: Wed, 05 Sep 2007 11:27:58 +0100
> To: <insight-developers at itk.org>
> Subject: [Insight-developers] experiences with writing Analyze and MetaIO
> images and orientation with ITK 3.2.0
> 
> Hi
> 
> I am using a marginally modified version of
> Examples/IO/DicomSeriesReadImageWrite2.cxx to read DICOM images and
> convert it into another file format.
> 
> After running into some problems, and reading a some previous posts
> http://public.kitware.com/pipermail/insight-users/2007-
> February/021144.html
> http://public.kitware.com/pipermail/insight-users/2007-March/021632.html
> and the wiki
> http://www.vtk.org/Wiki/Proposals:Orientation#Coordinate_Systems
> 
> I thought I'd summarize my conclusions and make some suggestions to the
> developers.
> 
> 
> SUGGESTION 1:
> add a few words to
> http://www.vtk.org/Wiki/Proposals:Orientation#Coordinate_Systems
> to update what the current status of this proposal is (my guess is that
> it is actually implemented already in 3.2).
> 
> 
> 1) writing Analyze 7.5 files (extension .hdr)
> 
> you can get the following message
> 
> ERROR: Analyze 7.5 File Format Only Allows RPI, PIR, and RIP Orientation
> here 
> 
> Despite the wording "ERROR", the program does continue, but writes a
> file in what Analyze calls AVW_CORONAL.
> 
> What happens is (I believe) not a bug, but correct behaviour: the
> AnalyzeIO class can only write those 3 orientations (it would be nice if
> the 2 missing ones could be added of course). itk::AnalyzeIO then
> defaults to the RIP orientation (coronal). My initial impression is that
> the output is actually correct. So...
> 
> SUGGESTION 2:
> change the wording (itkAnalyzeImageIO.cxx, line 1182) to something like
> 
> "WARNING: the ITK implementation of the Analyze 7.5 File Format can only
> write data using RPI, PIR, and RIP Orientation. Defaulting to RIP."
> 
> 
> 2) writing MetaIO (extension .mhd)
> 
> Everything works fine, aside from a known bug
> (http://www.itk.org/Bug/bug.php?op=vote&bugid=3311) that puts the wrong
> value in the AnatomicalOrientation field of the header. The suggested
> fix works fine in my (limited) experience.
> 
> SUGGESTION 3:
> fix the bug as suggested. It can have disastrous consequences.
> 
> Hope this helps someone else.
> 
> Many thanks
> 
> Kris Thielemans
> Hammersmith Imanet Ltd, part of GE Healthcare
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers



More information about the Insight-developers mailing list