[Insight-developers] AnalyzeIO.

Hans J. Johnson hans-johnson at uiowa.edu
Mon Feb 26 17:45:29 EST 2007


Kent,

First:

Maintain backwards compatibility in that all files must be written without
throwing an exception.  The current code, however, is going to allow writing
files that are not compliant with the Analyze75 definition of orientation.

With a little work, both backwards compatibility, and better compliance can
be met.  There is an UNKNOWN orientation (orientation code 6) that should be
used when the orientation does not meet one of the 6 definitions provided by
Analzye75.

The analyze IO code needs to be instrumented with

--- These already exists ---
itk::AnalyzeImageIO::ITK_ANALYZE_ORIENTATION_RPI_TRANSVERSE
itk::AnalyzeImageIO::ITK_ANALYZE_ORIENTATION_PIR_SAGITTAL
itk::AnalyzeImageIO::ITK_ANALYZE_ORIENTATION_RIP_CORONAL

--- These need to be instrumented -  Not recommended for use, but they are
valid codes--
itk::AnalyzeImageIO::ITK_ANALYZE_ORIENTATION_???_TRANSVERSE_FLIPPED
itk::AnalyzeImageIO::ITK_ANALYZE_ORIENTATION_???_SAGITTAL_FLIPPED
itk::AnalyzeImageIO::ITK_ANALYZE_ORIENTATION_???_CORONAL_FLIPPED

--- This should be the default Analyze tag when the direction cosiges do not
map to one of the 6 directions---
itk::AnalyzeImageIO::ITK_ANALYZE_ORIENTATION_UNKNOWN


That is to say that the AnalyzeIO should set the orientation field to the
Analyze75 specification of unknown (i.e. Code 6) when writing an unknown
value.  The Analyze75 reader may set the direction cosines to something that
is usable (but does not overlap with the 6 valid orientaitons).
Perhaps the following direction cosines should be paired with a code of 6.
0 0 1
0 1 0
1 0 0

We must be able to distinguish which files have orientation set that can be
trusted.  The current code commits that you proposed map
SAGITTAL-->SAGITTAL, TRANSVERSE-->TRANSVERSE, and the other 46 image
permutations to CORONAL.  It would be better to map the 42 directions that
AnaylzeIO does not deal with to the UNKNOWN tag with a value of 6.

I have a hunch that if the "FLIPPED" versions are included, there will be
very few images that actually fall into the UNKNOWN tag.

This will maintain backwards compatibility, and only break a few of our
tools (by broke I mean that they will now revert to giving the right/left
swap of brains).

============

Second:

We need to figure out how to un-register the AnalyzeIO reader from our ITK
tools.  The right/left swapping caused a month of lost data-processing last
fall, and I would rather impose that our internal tools must be re-written
to avoid Analyze at all costs.  The risk of publishing on r/l swapped data
is too high.

We will be able to keep Analyze75 if we can instrument something like the
following psuedo code:

Analyze75IO Analyze75FactoryInstance=itk::IOFactory->GetIO(Analzye75);
Analyze75FactoryInstance->SetSafeMode();

This would allow backwards compatibility, but allow medical imaging tools to
enforce a stricter standard.  This ramifications of this second part are not
completely thought out, but we can start putting together a proposal on
Friday when I return.

Thanks,
Hans



More information about the Insight-developers mailing list