Re: how to read/display an image like it's done in ENVI? [message #69227 is a reply to message #69226] |
Tue, 29 December 2009 06:06   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Hassan writes:
> do you think has something unusual happened?
I don't know. The code you sent doesn't work. Could
that be the problem?
Once I got the code to work, the ENVI value at [1,1]
corresponded exactly to the image value at [0,0].
Here is the code I used.
filename = 'bhdemsub.img'
ENVI_OPEN_FILE, filename, /NO_REALIZE , R_FID=FID
envi_file_query, fid, ns=dimX, nl=dimY, nb=nbBands,$
DATA_TYPE=dataType, OFFSET = HeaderOffSet, $
LOOKUP= lookup, class_names =classNames, $
num_classes = numClasses
map_Info = ENVI_GET_MAP_INFO(FID=FID)
image = read_binary(filename,data_Start = HeaderOffSet,$
data_Type=dataType, data_Dims=[dimX,dimY,nbBANDS],$
ENDIAN= "native")
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|