Re: file i/o help [message #30355] |
Thu, 18 April 2002 11:03 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
vijay (yeluri@eng.fiu.edu) writes:
> i have like a 100 dicom files. I want to generate a single volume file
> consisting of the 100 dicom files. I mean, a single file which would
> contain the 100 individual dicom files next to each other pixel by
> pixel.
Let's assume your DICOM images are 600 by 400 integer arrays,
and that your files are named something sensible like image001.dcm,
image002.dcm, ..., image100.dcm. (Big assumption, but I
don't have much time.)
Then you would write a program something like this:
FUNCTION FillVolume
volume = IntArr(600, 400, 100)
FOR j=0,99 DO BEGIN
filename = 'image' + String(j, Format='(I3.3)') + '.dcm'
volume[0,0,j] = Read_Dicom(filename)
ENDFOR
RETURN, volume
END
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
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
|
|
|