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/display an image like it's done in ENVI?
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: how to read/display an image like it's done in ENVI? [message #69226 is a reply to message #69225] Tue, 29 December 2009 06:25 Go to previous messageGo to previous message
Hassan is currently offline  Hassan
Messages: 48
Registered: October 2009
Member
On Dec 29, 2:06 pm, David Fanning <n...@dfanning.com> wrote:
> 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.")

yeah the code is fine. I did a silly mistake, I read the the data in
the wrong band I should've read [299,159,0] but I read [299,159,1]
instead.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL 8.0 compile_opt changes
Next Topic: Convolve a spectrum (from MODTRAN) with a spectral response function

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

Current Time: Wed Oct 08 20:09:02 PDT 2025

Total time taken to generate the page: 0.00470 seconds