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

Home » Public Forums » archive » Re: How to read a multi-band image with IDL
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: How to read a multi-band image with IDL [message #65047] Mon, 09 February 2009 09:24
Mort Canty is currently offline  Mort Canty
Messages: 134
Registered: March 2003
Senior Member
shi.bobopan@gmail.com schrieb:
> Hello! I will write a supervised classification programme and want to
> read a multi-band ETM+ image with IDL. But ENVI_GET_DATA function can
> only read one band. It seems that READ_IMAGE function also read gray
> image or RGB imge only. How can I read a multi-band image at one time?
> I am new in IDL. Thank you very much.

Here's how I always do it:

envi_select, title='Choose multispectral image', $
fid=fid, dims=dims,pos=pos

num_cols = dims[2]-dims[1]+1
num_rows = dims[4]-dims[3]+1
num_bands = n_elements(pos)

; BIP array
image = fltarr(num_bands,num_cols,num_rows)

for i=0,num_bands-1 do image[i,*,*] = $
envi_get_data(fid=fid,dims=dims,pos=pos[i])


Mort
Re: How to read a multi-band image with IDL [message #65053 is a reply to message #65047] Mon, 09 February 2009 06:23 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
shi.bobopan@gmail.com wrote:
> Hello! I will write a supervised classification programme and want to
> read a multi-band ETM+ image with IDL. But ENVI_GET_DATA function can
> only read one band. It seems that READ_IMAGE function also read gray
> image or RGB imge only. How can I read a multi-band image at one time?
> I am new in IDL. Thank you very much.

Hi,

from the top of my head, you could

1) open the file via ENVI_OPEN_FILE
2) get the image dimensions and other info (offset etc) via envi_file_query
3) read the data via read_binary

Jean
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Has anyone worked with ARF files and brought them into IDL successfully?
Next Topic: How to plot linear regression relation of two array?

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

Current Time: Wed Oct 08 13:39:58 PDT 2025

Total time taken to generate the page: 0.00476 seconds