contour data from RT structure set

1,402 views
Skip to first unread message

aerospace_guy_

unread,
Feb 1, 2011, 12:39:26 AM2/1/11
to pydicom
Hi All,

I have an RT structure set and I would like to extract the xyz
coordinates out of it. Accessing the contour data object using
reference_image.ROIContours returns a list which I have seen has one
entry for each structure in the set. Each of these entry's has a list
of all of the contours in the structure. When I try to access the
structures individually I get a key error. does anyone know how to get
to the contour data for individual contours in the structure?

Thanks in advance for any help.

Roy

unread,
Feb 1, 2011, 4:58:27 AM2/1/11
to pydicom
Normally you can access contour data in the structure set with a call
like:

ss = dicom.read_file('rtss.dcm')
ss.ROIContours[0].Contours[0].ContourData

That should return a list of contour points [x0, y0, z0, x1, y1,
z1, ...]

You might try looking at the dicom file in dicompyler or using one of
the modules from the dicompyler code (that is built on top of
pydicom).
Much of the juiciest code is in dicomparser.py

http://code.google.com/p/dicompyler/source/browse/dicomparser.py

Roy

aerospace_guy_

unread,
Feb 1, 2011, 6:25:19 PM2/1/11
to pydicom
Thanks, that worked. I'd have sworn I'd tried that before, but I must
have done something else.

Also thanks for the link to the dicompyler source. I've used
dicompyler before to open the structure and verify that the contours
were there, it's a very useful tool.

Steven
Reply all
Reply to author
Forward
0 new messages