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

Kris Thielemans kris.thielemans at csc.mrc.ac.uk
Wed Sep 5 06:27:58 EDT 2007


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



More information about the Insight-developers mailing list