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

Home » Public Forums » archive » Re: How to make a .Dat file from DICOM series?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to make a .Dat file from DICOM series? [message #22761] Fri, 01 December 2000 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Paolo Marcheschi (paolo@ifc.pi.cnr.it) writes:

> Hi I am new at programming in IDL.
>
> I'd like to make a .dat file from a series of DICOM images , is there a
> simple way to do it ?
> I wanto use slicer3 to analyze them.

Finally! A new user who wants to do something simple!
OK, I'll handle this one. :-)

Create a 3D array the same size as your images. The
third dimension will be the number of "frames" you
are going to have. Say each image is 300 by 400 and
you will have 10 of them. (I assume your DICOM
images are integer arrays.)

dataArray = IntArr(300, 400, 10)

Read each DICOM image and load it into the data array:

FOR j=0,9 DO BEGIN
filename = 'myfile' + StrTrim(j,2) + '.dcm'
image = Read_Dicom(filename)
dataArray[*,*,j] = image
ENDFOR

Send the whole mess to Slicer3:

ptr = Ptr_New(dataArray, /No_Copy)
Slicer3, ptr

If you want to save it out to a file:

OpenW, 'myfile.dat', lun, /Get_Lun
WriteU, lun, *ptr
Free_Lun, lun

That's it. Pretty simple. :-)

Cheers,

David

--
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
[Message index]
 
Read Message
Previous Topic: JHUAPL Library
Next Topic: Re: underscore bug?

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

Current Time: Sat Oct 11 14:10:49 PDT 2025

Total time taken to generate the page: 0.24149 seconds