[vtkusers] [Gdcm2] Matching CT and RT dose coordinates
Mark Roden
mmroden at gmail.com
Fri Feb 25 10:12:57 EST 2011
Hi Bill,
My theory (which I can't verify without knowing the orientation
vectors) has to do with how vtk handles orientation vectors in
comparison to DICOM.
DICOM specifies that patient position is the upper left corner, and
then provides direction vectors for display that indicate how the
image was acquired. Z direction is handled as the dot product of
direction cosines in another DICOM tag.
So, for instance, in the x direction, the upper left coordinate can be
-128, and then if the image is 256 pixels across with a spacing of 1,
the extent in the x dimension should be (-128, 128). The direction
cosine is irrelevant, from the perspective of DICOM, of calculating
the extent. However, if the direction is -1, vtk changes the extent
to (-384, -128). If the direction cosines are just 1 or -1, flipping
is straightforward. However, for MR images, the direction cosines are
almost guaranteed _not_ to be -1 or 1.
This hasn't been an issue until people want to overlay images on one
another, like RTDose/RTStruct on CT images. RTStructs are contours
represented by explicit coordinates using the DICOM definition of the
pixel locations, so RT images are almost always in the wrong spot in
VTK, and have to be flipped into the right position.
I do not know how to solve this issue, and I do not know if this is
the issue that Jothy is experiencing without knowing his direction
cosines. Is it a bug in the DICOM reader, in which case the DICOM
reader should be explicitly setting the extent array instead of
relying on the vtk interpretation? Would that cause some problems
with vtk then assuming that the direction cosines should create the
extent array?
Mark
On Thu, Feb 24, 2011 at 9:05 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Maybe I missed something.
>
> Why can't you use the same GDCM reader for both sets of images?
>
>
> On Thu, Feb 24, 2011 at 9:50 AM, Jothy <jothybasu at gmail.com> wrote:
>> FrameOfReferenceUIDs do match. I think the problem is with the different
>> readers used to read CT and RT dose.
>>
>> I will use ImagePositionPatient to register the coordinates.
>>
>> Thank you
>>
>> Jothy
>>
>> On Wed, Feb 23, 2011 at 6:04 PM, Scott Johnson <Scott.Johnson at neuwave.com>
>> wrote:
>>>
>>> If the FrameOfReferenceUIDs of the CT and the RT dose are the same, they
>>> both exist in the same coordinate system, if they don’t, you will have to
>>> register the dose to the CT somehow.
>>>
>>>
>>>
>>> Because the resolution of the dose will generally be different than the CT
>>> a reasonable strategy is to loop through your CT voxels and use the position
>>> at the center of that voxel to sample into the RT Dose grid. When you
>>> sample into the RT Dose you may need to interpolate the actual dose value.
>>> That dose value determines your shading.
>>>
>>>
>>>
>>> The other issue to be aware of is that the dose grid may not completely
>>> cover the CT image data. This is probably why the origins are different for
>>> your data.
>>>
>>>
>>>
>>> -- Scott
>>>
>>>
>>>
>>> From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf
>>> Of Jothy
>>>
>>> Sent: Wednesday, February 23, 2011 11:38 AM
>>> To: gdcm-developers; VTK Mailing List; itk;
>>> python-medphys at googlegroups.com
>>> Subject: [vtkusers] Matching CT and RT dose coordinates
>>>
>>>
>>>
>>> Hi all,
>>>
>>> I am trying to overlay an dose shade on a CT slice.I am using
>>> vtkDICOMImageReader to read the CT and vtkGDCMImageReader to display the
>>> dose shade.But I am having problem with the coordinates.How to relate the
>>> coordinates? For e.g: I get ImagePositionPatient of CT image for central
>>> slice as [-275,-524,-128.25] and ImagePositionPatient for dose as
>>> [-228.65,-419.25,-122.5] adn their spacings are [1.074,1.074,3] and
>>> [2.52.5.2.5] respectively for CT and Rt dose.
>>>
>>> The image looks as in the attached figure.
>>>
>>> Any hint
>>>
>>> Thanks
>>>
>>> Jothy
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
> ------------------------------------------------------------------------------
> Free Software Download: Index, Search & Analyze Logs and other IT data in
> Real-Time with Splunk. Collect, index and harness all the fast moving IT data
> generated by your applications, servers and devices whether physical, virtual
> or in the cloud. Deliver compliance at lower cost and gain new business
> insights. http://p.sf.net/sfu/splunk-dev2dev
> _______________________________________________
> Gdcm-developers mailing list
> Gdcm-developers at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gdcm-developers
>
More information about the vtkusers
mailing list