[Insight-developers] [GDCM] ITK Origin and coordinate system
Simon Warfield
warfield at crl.med.harvard.edu
Tue Jan 17 13:58:12 EST 2006
Lorensen, William E (GE, Research) wrote:
> My interpretation is the same as Leila's. I read that the origin is always in LPS. I think it needs to be transformed into the ITK coordinate farem.
>
How about the operation of ShrinkFilter or MultiresolutionPyramidFilter ?
When you specify an axis to shrink, are you specifying an axis based on
the implicit ordering of the indexes or an axis based on physical
coordinates ?
>
> -----Original Message-----
> From: Leila baghdadi [mailto:baghdadi at sickkids.ca]
> Sent: Tuesday, January 17, 2006 1:29 PM
> To: Mathieu Malaterre
> Cc: insight-developers at itk.org; Gordon Kindlmann; Lorensen, William E
> (GE, Research); Vince Magnotta
> Subject: Re: [Insight-developers] [GDCM] ITK Origin and coordinate
> system
>
>
> Hey petit frere,
>
> I think you are right about the origin being a fixed point, i.e, for the
> header information,
> but once you apply the direction cosines to the image (i.e, right before
> visualization), shouldn't the origin be resampled as well?
>
> Leila
>
> On Tue, 2006-01-17 at 13:08 -0500, Mathieu Malaterre wrote:
>
>> Bill,
>>
>> We are having a discussion with Gordon about a problem regarding the
>> Origin of an itkImage read from a DICOM file. A while ago you put this
>> code into itkGDCMImageIO(*). After discussion with Luis we came to the
>> conclusion that the Origin is a fixed point. If you want to compute a
>> point then yes you need to use the direction cosine and refer to the
>> origin. But the origin should not change, right ?
>>
>> Comments welcome,
>> Mathieu
>>
>>
>> (*)
>> // DICOM specifies its origin in LPS coordinate, regardless of how
>> // the data is acquired. itk's origin must be in the same
>> // coordinate system as the data. This code transforms the DICOM
>> // origin into the itk origin. The itk origin is computed by
>> // multiplying the inverse(transpose) of the direction cosine times
>> // the dicom origin.
>> vnl_vector<double> itkOrigin(3), dicomOrigin(3);
>> vnl_matrix<double> dicomDirection(3,3);
>> dicomOrigin[0] = header.GetXOrigin();
>> dicomOrigin[1] = header.GetYOrigin();
>> dicomOrigin[2] = header.GetZOrigin();
>> for (unsigned int ii = 0; ii < 3; ii++)
>> {
>> dicomDirection[0][ii] = rowDirection[ii];
>> dicomDirection[1][ii] = columnDirection[ii];
>> dicomDirection[2][ii] = sliceDirection[ii];
>> }
>> itkOrigin = dicomDirection * dicomOrigin;
>> m_Origin[0] = itkOrigin[0];
>> m_Origin[1] = itkOrigin[1];
>> m_Origin[2] = itkOrigin[2];
>> _______________________________________________
>> Insight-developers mailing list
>> Insight-developers at itk.org
>> http://www.itk.org/mailman/listinfo/insight-developers
>>
--
Simon K. Warfield, Ph.D. warfield at crl.med.harvard.edu
Phone: 617-732-7090 FAX: 617-582-6033
Associate Professor of Radiology, Harvard Medical School
Director, Computational Radiology Laboratory,
Departments of Radiology at Children's Hospital and
Brigham and Women's Hospital,
Thorn 329, Dept Radiology, Brigham and Women's Hospital
75 Francis St, Boston, MA, 02115
MA 280, Dept Radiology, Children's Hospital Phone: 617-355-4566
More information about the Insight-developers
mailing list