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

Home » Public Forums » archive » transparent routine using either readu or assoc for same array variable
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
transparent routine using either readu or assoc for same array variable [message #10854] Sun, 15 February 1998 00:00
Jacobus Koster is currently offline  Jacobus Koster
Messages: 3
Registered: February 1998
Junior Member
Ye of wisdom,
I would like to write a routine to open a file and read an image stack,
say 128x128 images, 96 of 'em. I would like to be able to pass a keyword

to this routine, telling it to either read the whole file into an image
array, or alternately associates it with such an array of the same name
and dimensions.
E.g.:

Procedure getimage_stack,filename,image,open=open

If keyword_set(open) then begin
?which commands to declare image as an array of 96 images of 128x128
integers?
Openr,1,filename
For I=0,95 do Readu,lun,image[I]
Endif else begin
Openr,1,filename
image=Assoc(1,intarr(128,128))
Endelse

End ; of getimage

pro process_image

getimage_stack,filename,image,open=(either 1 or 0)
image=intarr(128,128)
for i=0,95 do
image=image_stack(i)
do something with image
endfor
close_image (won't include here)
end

Can I name an array of 96 elements in this way, each array element being

a 128x128 image, or do I have to define a structure of 128x128 integer
arrays,
, and if so, can I use assoc and readu transparently
with the same array structure name ?

Thanks for your help,
Sjaak Koster
[Message index]
 
Read Message
Previous Topic: IDL 5.0 (TvRd LoadCt) problems with true colors ???
Next Topic: Horizontal error bars

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

Current Time: Wed Oct 08 19:51:22 PDT 2025

Total time taken to generate the page: 0.00411 seconds