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

Home » Public Forums » archive » Re: Get Patient Info out of DICO-Files
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: Get Patient Info out of DICO-Files [message #25828] Mon, 23 July 2001 09:58
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
Emmler, Oliver writes:
>
> i want to get the header-info out of DICOM-Files. Unfortunately i am not
> very familiar with Object-Programming.
>
> Does anyone has a solution for this and can post the source. I think i will
> be able to adapt the code.

Here is a very, very simple program that shows the
general idea. You will need my TVImage program to
run it.

http://www.dfanning.com/programs/tvimage.pro

Cheers,

David

************************************************************ ****
PRO Dicom_Example

; Open a Dicom file for reading.

filename = Filepath('mr_knee.dcm', SubDirectory=['examples', 'data'])
object = Obj_New('IDLffDicom')
ok = object->Read(filename)
IF NOT ok THEN BEGIN
Print, 'File: "' + filename + '" cannot be read. Returning...'
RETURN
ENDIF

; Print the patient name.

name = object->GetValue('0010'x, '0010'x)
Print, ""
IF Ptr_Valid(name[0]) THEN Print, ' Patient Name: ', *name[0]

; Print the patient age.

age = object->GetValue('0010'x, '1010'x)
IF Ptr_Valid(age[0]) THEN Print, ' Patient Age: ', *age[0]

; Print the patient history.

history = object->GetValue('0010'x, '21B0'x)
IF Ptr_Valid(history[0]) THEN Print, ' Patient History: ', *history[0]
Print, ""

; Display the image.

image = object->GetValue('7Fe0'x, '0010'x)
IF Ptr_Valid(image[0]) THEN TVImage, BytScl(*image[0]), Margin=0.1, $
/Keep_Aspect, /Erase

; Destroy the object.

Obj_Destroy, object

; Free the pointers.

Ptr_Free, name
Ptr_Free, age
Ptr_Free, history
Ptr_Free, image

END
************************************************************ ****

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@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: Typo: 8-bit images under X11 not 6-bit
Next Topic: FFT in a 2D variable in only one direction

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

Current Time: Wed Oct 08 13:26:19 PDT 2025

Total time taken to generate the page: 0.00483 seconds