[Tutor] DICOM Header

wesley chun wescpy at gmail.com
Thu Feb 22 20:32:32 CET 2007


>  I have Files that are written in DICOM format.  I want to be able to pull
> out select elements from the header of these files

for those who aren't in the industry, DICOM files are a digital
imaging format typically used by the medical industry.  it contains an
embedded JPG and lots of patient/medical metadata, and also includes a
networking protocol for exchanging such data across processes:

http://en.wikipedia.org/wiki/Digital_Imaging_and_Communications_in_Medicine


>  I have a dictionary file that contains enteries like this.
>
>  dicomdict = {
>  # meta tags
>  (0x0002,0x0001):('OB', "FileMetaInformationVersion",
>       '1', ''),
>  (0x0002,0x0002):('UI', "MediaStorageSOPClassUID",
>       '1', ''),
>  (0x0002,0x0003):('UI', "MediaStorageSOPInstanceUID",
>       '1', ''),
>  (0x0002,0x0010):('UI', "TransferSyntaxUID",
>       '1', ''),
>  (0x0002,0x0012):('UI', "ImplementationClassUID",
>       '1', ''),
>  (0x0002,0x0013):('SH', "ImplementationVersionName",
>       '1', ''),
>  (0x0002,0x0016):('AE', "SourceApplicationEntityTitle",
>       '1', ''),
>  (0x0002,0x0100):('UI', "PrivateInformationCreatorUID",
>       '1', ''),
>  (0x0002,0x0102):('OB', "PrivateInformation",
>       '1', ''),
>  }
>
>  I do understand how to use the dictionary file to help parse out the
> element that I want from the DICOM file.
>  For example how do I only grab the SourceApplicationEntityTitle from the
> DICOM header.

a few questions to help us understand the problem better:

how are you opening the file?
how are you parsing the file, and what kind of data structure is
holding all the data?
where is this dictionary defined?

once we know this info, i'm sure we can help out more.

thanks,
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2007,2001
    http://corepython.com

wesley.j.chun :: wescpy-at-gmail.com
python training and technical consulting
cyberweb.consulting : silicon valley, ca
http://cyberwebconsulting.com


More information about the Tutor mailing list