comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Reading Dicom Header
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Reading Dicom Header [message #35940] Mon, 28 July 2003 13:22
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
New2IDL writes:

> I am not sure how we can read the dicom headers from an image file.
> When i use some DICOM readers, i can see the info's. I want to read
> them in IDL. Can anybody help me please...

You will have to open the DICOM file something like this:

IDL> filename = 'mydicomimage.dcm'
IDL> thisObject = Obj_New('IDLffDicom', filename)

To see all of the header information, do this:

IDL> thisObject -> DumpElements

In the list that is printed out you will see a column of
numbers in parentheses. These are the Group and Element
numbers (in hexadecimal values). If you wish to obtain
one of the data elements, you have to use the Group and
Element numbers to do so.

For example, the Modality data element has a group number
of 0008 and an element number of 0060. If you wanted to
print the modality of this file, you would do something
like this:

IDL> modality = thisObject -> GetValue('0008'xL, '0060'xL)
IDL> Print, "Modality: ", *modality

Notice that the data element comes back in the form of a pointer.
To clean up, you would do this:

IDL> Ptr_Free, modality
IDL> Obj_Destroy, thisObject

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Reading Dicom Header
Next Topic: Delphi written DLL for use with CALL_EXTERNAL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 20:02:43 PDT 2025

Total time taken to generate the page: 0.02511 seconds