|
Project Information
Members
Featured
Downloads
Wiki pages
Links
|
pydicom is a pure python package for working with DICOM files. It was made for inspecting and modifying DICOM data in an easy "pythonic" way. The modifications can be written again to a new file. As a pure python package, it should run anywhere python runs without any other requirements. Here is a short code sample from an interactive python session: >>> import dicom
>>> plan=dicom.read_file("rtplan.dcm")
>>> plan.PatientsName
'Last^First^mid^pre'
>>> plan.dir("setup") # get a list of tags with "setup" somewhere in the name
['PatientSetups']
>>> plan.PatientSetups[0]
(0018, 5100) Patient Position CS: 'HFS'
(300a, 0182) Patient Setup Number IS: '1'
(300a, 01b2) Setup TechniqueDescription ST: ''
>>> plan.PatientSetups[0].PatientPosition = "HFP"
>>> plan.save_as("rtplan2.dcm")
>>>pydicom is not a DICOM server, and is not primarily about viewing images. It is designed to let you manipulate data elements in DICOM files with python code. Limitations -- the main limitation of the current version is that compressed pixel data (e.g. JPEG) cannot be altered in an intelligent way as it can for uncompressed pixels. Files can always be read and saved, but compressed pixel data cannot easily be modified. Testimonials -- see comments at the bottom of the GettingStarted and PydicomUserGuide pages. |