Finding dose for coordinates in a dose grid

541 views
Skip to first unread message

Tallhamer

unread,
Jan 13, 2011, 7:10:31 PM1/13/11
to Python in Medical Physics
I have a quick question for anyone out there familiar with DICOM RT
dose files. I have an arbitrary number of x,y,z coordinates and would
like to find the dose at these points for a given plan. If I export
the DICOMRT dose file from Eclipse is it possible to register my
points within the grid?

I use pydicom and can get the pixel data from the dose file but need
to determine the coordinates for the points on the grid so that I can
find the points I need to then interpolate the dose to my series of
x,y,z coordinates.

I see the GridFrameOffsetVector but it just looks like an array of
values ranging from 0 to the number of slices * the slice thickness. I
need the coordinate for one point on the grid and from there I can get
the rest using the grid spacing and the shape of the pixel_array.

Thanks,
Mike

flounder.sdt

unread,
Jan 13, 2011, 8:05:09 PM1/13/11
to python-...@googlegroups.com
Hey Mike,

In the DICOM patient coordinate system, the x axis increases to the
patient left, the y axis increases to patient posterior and the z axis
increases to patient superior. The Image Position (Patient) tag in the
DICOM dose file gives you the xyz coordinates of the center of the first
pixel. The Image Orientation (Patient) tag gives you the directional
cosines of the image axes with respect to that patient coordinate system.

If your patient is Head First Supine, you can generate xyz axes for your
pixel data like this (assuming I haven't botched the orientation):

image=dicom.read_file(filename)

rows = image.Rows
columns = image.Columns
pixel_spacing = image.PixelSpacing
image_position = image.ImagePositionPatient

x_axis = numpy.arange(columns)*pixel_spacing[0] + image_position[0]
y_axis = numpy.arange(rows)*pixel_spacing[1] + image_position[1]
z_axis = numpy.array(image.GridFrameOffsetVector) + image_position[2]

You can find a much better explanation of this in the Medical Image FAQ at
http://www.dclunie.com/medical-image-faq/html/part2.html
and a diagram in the presentation at
http://atc.wustl.edu/home/news/2004_dicom_workshop/WRB2004%20Image%20IODs%20v3.pdf

Steve

Carlos Gallego Molina

unread,
Jul 26, 2021, 5:22:31 PM7/26/21
to Python in Medical Physics
Hey everyone,

Once you have the axis, how you can create in Python a 2D array with the x_axis and y_axis that represents the coordenates of the planes?

Carlos Gallego Molina

unread,
Jul 26, 2021, 5:22:33 PM7/26/21
to Python in Medical Physics

Thank you!
El viernes, 14 de enero de 2011 a las 2:05:09 UTC+1, flound...@gmail.com escribió:

Suman Gautam

unread,
Feb 6, 2024, 8:34:40 AM2/6/24
to Python in Medical Physics
Hi everyone 

I am wandering how to get the dose at the particualr coordiantes. I am able to create an array for x_axis, y_axis and z_axis. But won't get the dose at that particualr coordiantes. Could you please reply me?
Reply all
Reply to author
Forward
0 new messages