[Insight-users] itkAnalyze Valid Orientations and 3D - 2D conversions

Luis Ibanez luis.ibanez at kitware.com
Thu Apr 2 13:07:17 EDT 2009



There are a couple of new bugs in the MANTIS bug tracker


       http://www.vtk.org/Bug/view.php?id=8832
       http://www.vtk.org/Bug/view.php?id=8650


Related to Orientation (Direction) issues when reading and
writing Analyze 3D and 2D images.


      As usual,
      this is the consequence of lack of testing...  :-/


Therefore, before making any further changes, we are putting
together a full set of orientation tests, that we expect the
Analyze reader should be able to pass.


You can find this test under:

           Insight/Testing/Code/IO/
               itkAnalyzeImageIODirectionsTest.cxx

It currently generates 3D images with each one of the three
supported orientations, and save them and read them back.


Now we are starting to add the interactions with 2D reading.


Let's start with some definitions.

Analyze supports only three image orientations:

Axial (RPI)
Direction =
   1   0   0
   0  -1   0
   0   0   1

Sagittal (PIR)
Direction =
   0   0   1
  -1   0   0
   0   1   0

Coronal (RIP)
Direction =
   1   0   0
   0   0  -1
   0   1   0


The matrices presented here were printed out directly
from image->GetDirection(). They must be read as columns.

That is, the first column is the (x,y,z) components of
the vector indicating the direction along which the pixel
index changes the fastest.

Given that ITK uses the DICOM default orientation, which
is LPS. An Identity matrix in the Direction type would
correspond to... LPS.

In the Analyze description, however the axis are labeled
from the origin of the orientation vector, instead of its
destination. Therefore, what we call LPS, becomes RAI.

In the matrices above, then:

The column
1
0
0
stands for "R" (Analyze Right) ( the "L" of LPS in DICOM)

The Column
  0
  0
  1
stands for "I" (Analyze Inferior) (the "S" of LPS in DICOM)

The Column
  0
-1
  0
stands for "P" (Analyze Posterior) (the -"P" of LPS in DICOM).


The current test is working fine when writing a 3D image
and reading it back as a 3D image, for each one of these
three orientations.


---------


When starting to test the 3D and 2D combinations, the following
questions arise:


1) When instantiating a 2D image (that we plan to write out).

    What are the orientations that
    Analyze is supposed to support ?


2) When reading a 3D image in any of the orientations listed
    above (RPI, RIP, PIR), we are assuming that the resulting
    2D image will simply have an 2D orientation matrix with
    an identity matrix. Given that there is no way to represent
    its original 3D orientation by using a 2D matrix.



   Thanks for any suggestions,


      Luis




More information about the Insight-users mailing list