[Insight-developers] itkOrientedImage type definition

Gordon Kindlmann gk at bwh.harvard.edu
Sun Sep 25 11:44:35 EDT 2005


hello,

Alex, you are correct.

But the space in which the coordinates of the direction cosines are  
measured will be accessible in the metadata dictionary under the  
"NRRD_space" key, and will have values of either:

   "right-anterior-superior",
   "left-anterior-superior", or
   "left-posterior-superior"

for RAS, LAS, and LPS, respectively.  Actually there are more  
possibilities (look at line 675 of Insight/Utilities/NrrdIO/ 
enumsNrrd.c), but those are the big three (based on existing medical  
file formats).  See also:
http://teem.sourceforge.net/nrrd/format.html#space

Note that I'm using RAS, LAS, and LPS to name coordinate systems, and  
*not* as so-called "orientation codes".

Of course, I'd love it if ITK, like Nrrd, could explicitly name the  
coordinate system in which its direction cosines are measured, and be  
agnostic about which space is used.  But based on the mail from Bill  
(that you originally quoted, below), and based on this feedback from  
Kent Williams ...

On Aug 23, 2005, at 10:52 AM, Kent Williams wrote:
> Gordon (and others): I am working on the nifti ImageIO right now.  
> There's a version right now, that will be included in the next  
> checkpoint release, that just supports reading NIFTI files and  
> doesn't consider orientation at all.
>
> After the checkpoint release, I'll be checking in a version that A)  
> both reads and writes and B) handles embedded orientation information.
>
> The 'gold standard' of orientation in ITK is (and will be) the  
> DICOM direction cosines.  In other words, the direction cosines in  
> itk::ImageBase will be either A) the image file format's native  
> orientation information converted to Dicom Direction Cosines or B)  
> 'Identity' direction cosines, with no indication of anatomical  
> orientation.
>
> An open issue would be how to determine if the Direction Cosines  
> just happen to correspond to Identity, or if no orientation  
> information is given.  In Dicom terms, identity would correspond to  
> Transverse scan, with dimensions (fastest moving to slowest)   
> Patient right to left, anterior to posterior, inferior to superior.
>
> Presumably, once the orientation issues get settled in Insight, any  
> remaining ambiguity can be addressed by the client application --  
> one presumes any specific applications could make some simplifying  
> assumptions about the input data.

... it seems that the choice of the LPS coordinate system has been  
finalized, even if the different readers in ITK 2.2 don't behave  
entirely in line with that.

Everyone- is my understanding correct?

So, given the timing of that message prior to the ITK 2.2 release, I  
didn't want to modify Insight/Code/IO/itkNrrdImageIO.cxx to convert  
from the coordinate system defined in the NRRD header, to LPS, and  
risk breaking it.

Now that ITK 2.2 is done, I supposed I should enhance the orientation  
handling in itkNrrdImageIO.cxx (for example, when writing to NRRD it  
should explicitly name LPS as the orientation coordinate system), but  
that's not going to fix what's in the 2.2 branch.

Gordon



On Sep 25, 2005, at 10:48 AM, Alex Yarmarkovich wrote:

> It looks that in ITK2.2 release the image orientation cosines  
> coming from NRRD reader are in the original coordinate system  
> defined in NRRD header, not LPS.
>
> Alex
>
>
> Lorensen, William E (Research) wrote:
>
>
>> Good point. I'll have to check.
>>
>> -----Original Message-----
>> From: Gordon Kindlmann [mailto:gk at bwh.harvard.edu]
>> Sent: Thursday, August 18, 2005 4:19 PM
>> To: Lorensen, William E (Research)
>> Cc: " " <insight-users at itk.org>; Insight-developers (E-mail)
>> Subject: Re: [Insight-developers] itkOrientedImage type definition
>>
>>
>>
>> If the orientation information came from Analyze or NIFTI, is it   
>> converted to LPS?
>>
>> Gordon
>>
>> On Aug 18, 2005, at 4:08 PM, Lorensen, William E (Research) wrote:
>>
>>
>>
>>> I believe that the direction cosines in ITK are always in LPS. I   
>>> just copy in the dicom direction cosines.
>>>
>>> Bill
>>>
>>> -----Original Message-----
>>> From: insight-developers-bounces+lorensen=crd.ge.com at itk.org
>>> [mailto:insight-developers-bounces+lorensen=crd.ge.com at itk.org] 
>>> On  Behalf
>>> Of Simon Warfield
>>> Sent: Thursday, August 18, 2005 3:01 PM
>>> To: insight-users at itk.org; insight-developers at itk.org
>>> Subject: [Insight-developers] itkOrientedImage type definition
>>>
>>>
>>>
>>> I am looking at the documentation that describes directions here:
>>> http://www.itk.org/Doxygen/html/classitk_1_1Image.html#w14
>>>
>>> This indicates that there is the possibility to represent a  
>>> matrix of
>>> direction cosines.
>>> Direction cosines represent the angle between two sets of basis   
>>> vectors.
>>> http://mathworld.wolfram.com/DirectionCosine.html
>>>
>>> In order to understand what the orientation of an  
>>> itkOrientedImage is,
>>> there must be some way to specify or to record what those basis   
>>> vectors are.
>>> For example, the definition of DICOM direction cosines warrants that
>>> what is being provided is the angle between the patients anatomy  
>>> in  what
>>> is referred to as the Left-Posterior-Superior orientation and  
>>> the  image
>>> columns and rows.
>>>
>>>  With respect to what are the ITK direction cosines computed ?   
>>> If it
>>> is not specified then the orientation of an image containing such
>>> direction cosines is still unknown, which would defeat the  
>>> purpose of
>>> providing an orientation.
>>>
>>> --
>>> Simon
>>>
>>> _______________________________________________
>>> Insight-developers mailing list
>>> Insight-developers at itk.org
>>> http://www.itk.org/mailman/listinfo/insight-developers
>>> _______________________________________________
>>> Insight-developers mailing list
>>> Insight-developers at itk.org
>>> http://www.itk.org/mailman/listinfo/insight-developers
>>>
>>>
>>>
>>
>> _______________________________________________
>> 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