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

Home » Public Forums » archive » Re: Putting bands together
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: Putting bands together [message #42785] Thu, 24 February 2005 06:08
julio is currently offline  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 Go to previous message
julio is currently offline  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 Go to previous message
enod is currently offline  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 Go to previous message
David Fanning is currently offline  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/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Singular jacobian in broyden
Next Topic: ENVI Error: Negative position argument not allowed

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

Current Time: Wed Oct 08 19:27:49 PDT 2025

Total time taken to generate the page: 0.00815 seconds