Jay
unread,Apr 25, 2011, 8:53:17 PM4/25/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Python in Medical Physics
Hi,
I'm starting a project that will involve manipulating large dicom
files. The files are exported fluence maps from the TPS. I'm using
Python 2.7 and pydicom to read the file.
The following commands work for reading the dcm
>>> import dicom
>>> ds=dicom.read_file("test.dcm")
The first step is to search the file's 7943 lines for certain tags
like "Leaf Sequence"
i tried this command with no success
>>> import string
>>> string.find(ds,'Leaf Sequence')
The error message was
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
string.find(ds,'Leaf Sequence')
File "C:\Python27\lib\string.py", line 361, in find
return s.find(*args)
File "C:\Python27\lib\site-packages\dicom\dataset.py", line 234, in
__getattr__
raise AttributeError, "Dataset does not have attribute '%s'." %
name
AttributeError: Dataset does not have attribute 'find'.
Does anyone have an alternative solution?
Thanks,
Jay