Re: Putting bands together [message #42785] |
Thu, 24 February 2005 06:08 |
julio
Messages: 31 Registered: December 2003
|
Member |
|
|
Hello...
I finally got what I wanted. After openning 'i' images, I did:
OPENR, cab, image[i],/GET_LUN
temp = fltarr(nc,nl,nb)
READU, cab, temp
;n = number of images
if i eq 0 then begin
comp=fltarr(nc,nl,n)
endif
comp[*,*,i] = temp
The comp image has 'i' bands. Thanks for the comments!
Julio
|
|
|
Re: Putting bands together [message #42787 is a reply to message #42785] |
Thu, 24 February 2005 02:55  |
julio
Messages: 31 Registered: December 2003
|
Member |
|
|
Hello there,
The images are small... The problem is I don't know the number of
images to put together. The final multiband image can contain any
number of bands (2 up to 20)...
How can I read one by one and put them into an array?
Here goes what I'm tring:
; pick the files
ARQ = DIALOG_PICKFILE(/READ, Title=['Selecione Arquivos de Entrada'],$
FILTER = ['*.mvc'],path=dir,/MULTIPLE_FILES)
n = N_ELEMENTS(arq)
; open each file and put into temp array
for i=0,n-1 do begin
OPENR, cab, arq[i],/GET_LUN
temp = fltarr(nc,nl,nb)
READU, cab, temp
endfor
|
|
|
Re: Putting bands together [message #42794 is a reply to message #42787] |
Wed, 23 February 2005 18:49  |
enod
Messages: 41 Registered: November 2004
|
Member |
|
|
The method depends on the size of those images. For large images, it is
impossible to read the whole image into memory, which makes it more
difficult to do especially when the resulting image is not in BSQ
format. In this case, I think using ASSOC can be a good choice. To get
a BSQ multi-band image, you can just read and write images one-by-one.
If single image is too large to read as a whole, then you should read a
small part (say, one line) of the image repeatedly.
Tian
Julio wrote:
> Hello folks...
>
> I have a lot of image files and each file has only one band. I want
to
> join 'n' images in just only one file (with 'n' bands).
> How can I do that?
>
> Any comments wellcome.
>
> Thanks and best regards,
> Julio
|
|
|
Re: Putting bands together [message #42799 is a reply to message #42794] |
Wed, 23 February 2005 13:28  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Julio writes:
> I have a lot of image files and each file has only one band. I want to
> join 'n' images in just only one file (with 'n' bands).
> How can I do that?
I think I would read them in one by one, concatenate them
together, and write them back out. Is there any particular
part of that sequence you are having trouble with?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|