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

Home » Public Forums » archive » Re: Efficient Programing (reading multiband image)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Efficient Programing (reading multiband image) [message #4782 is a reply to message #4779] Thu, 27 July 1995 00:00 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
dean@phobos.cira.colostate.edu wrote:
> I use the following code to read in an interleave (by pixel) raster image.
(stuff deleted)
> IImage = BYTarr(nchan,nx,ny)

As long as you know the image interleave format, you can read the whole
image in one hit. The interleave options available are

(1) Band interleaved - image dimensioned as ( pixels, lines, bands )
i.e. all pixels and lines for band 1; all pixels and lines for band 2; ....

(2) Line interleaved - image dimensioned as ( pixels, bands, lines )
i.e. all pixels for band 1, line 1; all pixels for band 2, line 1; ....

(3) Pixel interleaved - image dimensioned as ( bands, pixels, lines )
i.e. all bands for pixel 1, line 1; all bands for pixel 2, line 1; ....

(See IDL 4.0 Ref. Guide p. 1-927, paragraph 2)

You identified the image as pixel interleaved, so you can do the following:

openr, 1, 'image.dat'
image = bytarr( nchan, nx, ny )
readu, 1, image
close, 1
nchan = 0
tvscl, image( nchan, *, * )

If you are interested, I have a compound widget that lets you
interactively pick a data file and specify the data type, size, and interleave.
The data file is then read, and the contents returned in an array.
BYTE, INTEGER, LONG, and FLOAT data types are supported, and an image header offset
in bytes can be specified.

Cheers,
Liam.

liamg@ssec.wisc.edu
[Message index]
 
Read Message
Read Message
Previous Topic: Efficient Programing
Next Topic: Re: Writing graphics device drivers using idl

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

Current Time: Sun Oct 12 12:03:51 PDT 2025

Total time taken to generate the page: 1.20041 seconds