[Insight-developers] [GDCM] ITK Origin and coordinate system

Gordon Kindlmann gk at bwh.harvard.edu
Wed Jan 18 08:44:46 EST 2006


hello,

On Jan 18, 2006, at 6:08 AM, Luis Ibanez wrote:

> It seems that it will be helpful to add a couple of definitions  
> here ...

Thank you for the self-contained explanation!

> 1) Image Grid ...
> 2) Image Coordinate System ...
> 3) Physical Coordinate System ...
>
> ...
>
> Our question at this point is whether DICOM specifies the Image Origin
> in the "Image Coordinate System" or in the "Spatial Coordinate  
> System".
>
>    ... and the answer to that question
>        is still to be determined with certainty...

Really?  Reading this:
http://www.vtk.org/Wiki/ 
Proposals:Orientation#Some_notes_on_the_DICOM_convention_and_current_ITK 
_usage

which quotes from:
http://medical.nema.org/dicom/2003/03_03PU.PDF
Section C.7.6.2.1.1, page 237:

"
The Image Position (0020,0032) specifies the x, y, and z coordinates  
of the upper left hand corner of the image; it is the center of the  
first voxel transmitted. Image Orientation  (0020,0037) specifies the  
direction cosines of the first row and the first column with respect  
to the patient. These Attributes shall be provide as a pair. Row  
value for the x, y, and z axes respectively followed by the Column  
value for the x, y, and z axes respectively.

The direction of the axes is defined fully by the patient’s  
orientation. The x-axis is increasing to the left hand side of the  
patient. The y-axis is increasing to the posterior side of the  
patient. The z-axis is increasing toward the head of the patient.

The patient based coordinate system is a right handed system, i.e.  
the vector cross product of a unit vector along the positive x-axis  
and a unit vector along the positive y-axis is equal to a unit vector  
along the positive z-axis.
"

That means unambiguously that "Image Position (0020,0032)", which is  
the only possible source of origin information, is giving the origin  
coordinates in the same LPS coordinate system as the direction  
cosines are measured in, which is consistent with the simple  
statement of image coordinates to physical coordinates you defined  
previously:

>>>        Point = M * S * Index + Origin


> Bill's experiment points to the conclusion that the origin is given
> by DICOM in the "Image Coordinate System" and therefore need to be
> converted to the "Physical Coordinate System" using Eq.(1).

Bill- are these scans still around?  It would great to manually  
inspect their "Image Position" tags, and confirm your alignment  
results with a different vis program that doesn't use GDCM.

> We must fear the posibility that different scanner vendors interpret
> the origin definition in different ways....

I'm not afraid of that- image orientation and position are too  
fundamental to get wrong.  DICOM experts are welcome to correct me!

And, even if there was a non-conformant DICOM writer in a scanner,  
its not ITK's responsibility to provide the work around.

And, even if such work-arounds where made available in ITK, they  
should not be the default behavior of ITK's DICOM reader.

Gordon

>
>
>
>      Luis
>
>
>
> -------------------------
> Gordon Kindlmann wrote:
>> hello,
>> Sorry to be a total pest, but can someone help me understand the   
>> relationship between
>> 1) itkImage
>> 2) itkOrientedImage
>> 3) The nice mathematical description that Luis previously gave:
>>>
>>>        Point = M * S * Index + Origin
>>>
>> Peter, can you help me understand what you mean by "local image   
>> coordinates"?  It is the same as the "Index" that appears in  
>> Luis's  description?
>> Gordon
>> On Jan 18, 2006, at 2:13 AM, Peter Cech wrote:
>>> On Tue, Jan 17, 2006 at 23:14:13 -0500, Bill Lorensen wrote:
>>>
>>>> In your experiment you must use an itkOrientedImage, not an   
>>>> itkImage. Is
>>>> that what you used?
>>>
>>>
>>> Exactly. My data volumes are not axis-aligned and  
>>> itkOrientedImage  gives
>>> much better spatial relation between anatomical structures (in  
>>> global
>>> coordinates).
>>>
>>> itkImage assumes not only volume to be axis-aligned, but local frame
>>> actually matches global ITK frame. Recent decision to fix global ITK
>>> frame as LPS breaks this assumption.
>>>
>>> We clearly need different treatment of origin in itkImage and
>>> itkOrientedImage. What about having two representations of  
>>> origin: in
>>> global ITK coordinates and in local image coordinates? Local origin
>>> would be permuted and axis-flipped to match itkImage orientation  
>>> (for
>>> axis-aligned images, it's the same as applying direction cosines to
>>> origin, for the rest permutation+flipping would retain behavior from
>>> before direction cosines were introduced).
>>>
>>> How do you like the idea?
>>>
>>> Regards,
>>> Peter
>>>
>>>>
>>>> Bill
>>>>
>>>> At 08:13 PM 1/17/2006, Peter Cech wrote:
>>>>
>>>>> On Tue, Jan 17, 2006 at 18:06:02 -0500, Bill Lorensen wrote:
>>>>>
>>>>>> In an experiment I did a few months back, I had 6 MR scans  
>>>>>> done  of the
>>>>>
>>>>> same
>>>>>
>>>>>> object in each of the 6 orthogonal directions. I read them in   
>>>>>> using the
>>>>>> current GDCMImageIO  (which transforms the origin using the   
>>>>>> direction
>>>>>> cosines). All of the volumes roughly lined up without any   
>>>>>> additional
>>>>>> transformations.
>>>>>>
>>>>>> If I did not apply the direction cosines, the datasets were  
>>>>>> all  shifted.
>>>>>
>>>>>
>>>>> I got several MRI scans of head, the same scanning sequence,  
>>>>> but  taken
>>>>> at various times over last half-year. My experience is exactly   
>>>>> opposite
>>>>> to yours. With directional cosines applied to origin, there   
>>>>> alignment
>>>>> was very poor (cca. 10cm shift, both in I-S and A-P  
>>>>> direction).  Today I
>>>>> tried without directional cosines applied to origin and they  
>>>>> aligned
>>>>> much better, maximum shift was around 5cm and only in S-I  
>>>>> direction.
>>>>>
>>>>>> Go figure,
>>>>>
>>>>>
>>>>> Yes, go figure...
>>>>>
>>>>> Regards,
>>>>> Peter
>>>>> _______________________________________________
>>>>> 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