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

Home » Public Forums » archive » Display ENVI image
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
Display ENVI image [message #38222] Fri, 27 February 2004 17:13 Go to next message
kini is currently offline  kini
Messages: 6
Registered: February 2004
Junior Member
Dear IDL fans,

Could any of you tell me how to display an ENVI image using IDL
statements *ONLY*? I have pasted a sample header of one of my images
and few pixel values below. Thanks,

Kind regards, Ananth Kini
____________________________________________________________ _____

Ananth Kini, Masters in Computer Science, Dept. of Computer Science
Harvey R. Bright Bldg, TAMU, College Station, TX 77843
#4302, College Main, Apt 319, Bryan, TX 77801, Phone : 979-260-1954
kini@tamu.edu

~~~~~~~~~~~~~~~~~~~~~~~
Header for the image :
~~~~~~~~~~~~~~~~~~~~~~~
ENVI
description = {
Band Math Result, Expression = [b1-b2] B1:IDL Var (GRID2USE): Band
1:top_ne
B2:Resize (IDL Var (GRID2USE): Band 1:dem05):dem05_ne [Tue Aug 27
10:50:33
2002]}
samples = 911
lines = 1025
bands = 1
header offset = 0
file type = ENVI Standard
data type = 4
interleave = bsq
sensor type = Unknown
byte order = 0
map info = {UTM, 1.000, 1.000, 267395.000, 4710962.000, 0.50000000,
0.50000000, 19, North, North America 1983, units=Meters}
band names = {
Band Math (b1-b2)}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A few lines of the Image in txt format :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

260.41030637679 258.54610420775 257.90058375188 257.86756287792
258.29545975217 259.41236266759 261.56417656466 263.58179186559
263.33916031169 263.09019177755
266.5623083806 266.89780636206 266.96359370066 266.88982376035
265.19163257385 262.22613299831 258.91229835752 255.55892418477
252.94160340385 254.03868960702
255.01569251246 255.13698479834 254.09015990297 254.46257463323
256.36905739234 258.00587806741 258.80451711212 258.83204686007
259.62626934708 259.64372058468
259.56695221087 259.3228828278 258.35937899198 257.47955782462
258.96730710575 263.01956245718 265.86809588025 265.95783568628
265.75716787989 265.44317921053
265.05762098573 264.50929943098 263.87448811865 263.35316143086
263.07107935878 262.98474259373 263.03686241468 263.16921649001
263.44196014284 263.34972913849
263.02686019665 263.28217655852 264.3562350276 265.2905361274
264.89379815572 264.85981680883 264.42978038595 262.49355841246
255.33281508398 255.24348004426
259.80155101039 263.59021511065 264.88504292792 261.99941874996
258.93081809645 264.37490167826 265.20596200951 263.80464630402
261.63252832176 259.46978471187
257.23808469505 256.47134331318 256.31369746171 256.21452983508
256.81148883512 258.79874357824 261.77043614264 ....
Re: Display ENVI image [message #38271 is a reply to message #38222] Tue, 02 March 2004 14:13 Go to previous messageGo to next message
jnettle1 is currently offline  jnettle1
Messages: 27
Registered: January 2001
Junior Member
You might also try setting !ORDER = 1. As I recall, ENVI considers
the 0,0 point of an image to be the upper left corner, while in IDL
the default is lower left (which is !ORDER = 0).

Hope that helps.

Jeff




David Fanning <david@dfanning.com> wrote in message news:<MPG.1aad6ce5e0f874479896c1@news.frii.com>...
> Ananth Kini writes:
>
>> Thank you for the reply. But, I am still awaiting an answer for how to
>> display this image. Example, using commands such as "TV".
>>
>> Though I used the "TV"command, I could not quite get the same visual
>> effect as it had when the image was displayed in ENVI application.
>> Could you tell me why this might be happening?
>
> I don't know. What kind of visual effect *did* you get?
> Maybe it just needs to be scaled. Does TVSCL give you
> a better effect than TV? ENVI sometimes applies some kind
> of image "stretch" to the image before displaying it. Try
> putting it in my XStretch program. Can you get it to look
> like the image in ENVI?
>
Re: Display ENVI image [message #38291 is a reply to message #38222] Mon, 01 March 2004 18:30 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Kenneth P. Bowman writes:

> Since I am reading this note in my apartment in Boulder, if he comes all
> the way here, I'll just send him on to Fort Collins to sit at the feet
> of the master. :-)

My gosh, I've been trading e-mails with you all day,
and you are in Boulder! We could probably solve this
XVolume thing over a beer or two. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Display ENVI image [message #38292 is a reply to message #38222] Mon, 01 March 2004 17:10 Go to previous messageGo to next message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <MPG.1aad6ce5e0f874479896c1@news.frii.com>,
David Fanning <david@dfanning.com> wrote:

> Why don't you just look up Ken Bowman there at Texas A&M
> and tell him the guys on the IDL newsgroup said to spend
> 10 minutes with you introducing you to IDL. I'm sure
> he would be pleased to do it. :-)
>
> Cheers,
>
> David

Since I am reading this note in my apartment in Boulder, if he comes all
the way here, I'll just send him on to Fort Collins to sit at the feet
of the master. :-)

Ken (temporarily at NCAR) Bowman
Re: Display ENVI image [message #38295 is a reply to message #38222] Mon, 01 March 2004 14:53 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ananth Kini writes:

> Thank you for the reply. But, I am still awaiting an answer for how to
> display this image. Example, using commands such as "TV".
>
> Though I used the "TV"command, I could not quite get the same visual
> effect as it had when the image was displayed in ENVI application.
> Could you tell me why this might be happening?

I don't know. What kind of visual effect *did* you get?
Maybe it just needs to be scaled. Does TVSCL give you
a better effect than TV? ENVI sometimes applies some kind
of image "stretch" to the image before displaying it. Try
putting it in my XStretch program. Can you get it to look
like the image in ENVI?

IDL> XStretch, image

You can find XStretch here:

http://www.dfanning.com/programs/xstretch.com

Why don't you just look up Ken Bowman there at Texas A&M
and tell him the guys on the IDL newsgroup said to spend
10 minutes with you introducing you to IDL. I'm sure
he would be pleased to do it. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Display ENVI image [message #38296 is a reply to message #38222] Mon, 01 March 2004 14:10 Go to previous messageGo to next message
kini is currently offline  kini
Messages: 6
Registered: February 2004
Junior Member
Dear Mr.Fanning,

Thank you for the reply. But, I am still awaiting an answer for how to
display this image. Example, using commands such as "TV".

Though I used the "TV"command, I could not quite get the same visual
effect as it had when the image was displayed in ENVI application.
Could you tell me why this might be happening?

Thank you for your time, Kini
____________________________________________________________ _____

Ananth Kini, Masters in Computer Science, Dept. of Computer Science
Harvey R. Bright Bldg, TAMU, College Station, TX 77843
#4302, College Main, Apt 319, Bryan, TX 77801, Phone : 979-260-1954
kini@tamu.edu, kiniananth@hotmail.com
http://students.cs.tamu.edu/auk3908/


David Fanning <david@dfanning.com> wrote in message news:<MPG.1aaa612be62ba4ce9896b9@news.frii.com>...
> Ananth Kini writes:
>
>> Could any of you tell me how to display an ENVI image using IDL
>> statements *ONLY*? I have pasted a sample header of one of my images
>> and few pixel values below.
>> ~~~~~~~~~~~~~~~~~~~~~~~
>> Header for the image :
>> ~~~~~~~~~~~~~~~~~~~~~~~
>> ENVI
>> description = {
>> Band Math Result, Expression = [b1-b2] B1:IDL Var (GRID2USE): Band
>> 1:top_ne
>> B2:Resize (IDL Var (GRID2USE): Band 1:dem05):dem05_ne [Tue Aug 27
>> 10:50:33
>> 2002]}
>> samples = 911
>> lines = 1025
>> bands = 1
>> header offset = 0
>> file type = ENVI Standard
>> data type = 4
>> interleave = bsq
>> sensor type = Unknown
>> byte order = 0
>> map info = {UTM, 1.000, 1.000, 267395.000, 4710962.000, 0.50000000,
>> 0.50000000, 19, North, North America 1983, units=Meters}
>> band names = {
>> Band Math (b1-b2)}
>
> I don't have ENVI here, but I think what this header is telling you
> is that the image (which is stored in a separate file, as I understand
> it) is simply a 911 by 1025 2D image of floating point (type=4) data.
>
> To read it, you would do this:
>
> image = FltArr(911,1025)
> OpenR, lun, whateverItsNameIs, /Get_Lun
> ReadU, lun, image
> Free_lun, lun
>
> That's it. Takes some of the mystery out of ENVI, doesn't it. :-)
>
> There might be some other complications (byte ordering, etc.)
> depending upon your particular IDL environment (which you don't
> tell us about), but this should get you pointed in the right direction.
>
> Cheers,
>
> David
Re: Display ENVI image [message #38318 is a reply to message #38222] Sat, 28 February 2004 07:26 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ananth Kini writes:

> Could any of you tell me how to display an ENVI image using IDL
> statements *ONLY*? I have pasted a sample header of one of my images
> and few pixel values below.
> ~~~~~~~~~~~~~~~~~~~~~~~
> Header for the image :
> ~~~~~~~~~~~~~~~~~~~~~~~
> ENVI
> description = {
> Band Math Result, Expression = [b1-b2] B1:IDL Var (GRID2USE): Band
> 1:top_ne
> B2:Resize (IDL Var (GRID2USE): Band 1:dem05):dem05_ne [Tue Aug 27
> 10:50:33
> 2002]}
> samples = 911
> lines = 1025
> bands = 1
> header offset = 0
> file type = ENVI Standard
> data type = 4
> interleave = bsq
> sensor type = Unknown
> byte order = 0
> map info = {UTM, 1.000, 1.000, 267395.000, 4710962.000, 0.50000000,
> 0.50000000, 19, North, North America 1983, units=Meters}
> band names = {
> Band Math (b1-b2)}

I don't have ENVI here, but I think what this header is telling you
is that the image (which is stored in a separate file, as I understand
it) is simply a 911 by 1025 2D image of floating point (type=4) data.

To read it, you would do this:

image = FltArr(911,1025)
OpenR, lun, whateverItsNameIs, /Get_Lun
ReadU, lun, image
Free_lun, lun

That's it. Takes some of the mystery out of ENVI, doesn't it. :-)

There might be some other complications (byte ordering, etc.)
depending upon your particular IDL environment (which you don't
tell us about), but this should get you pointed in the right direction.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Display ENVI image [message #38331 is a reply to message #38271] Wed, 03 March 2004 15:52 Go to previous message
kini is currently offline  kini
Messages: 6
Registered: February 2004
Junior Member
Dear Jeff,

Thank you for the input. That was a very good point you bought out.
Since I was aware of that aspect, we used to rotate the ENVI image.
However, your solution looks compact.

Kind regards, Ananth Kini.

jnettle1@utk.edu (Jeff) wrote in message news:<330af58b.0403021413.79c394be@posting.google.com>...
> You might also try setting !ORDER = 1. As I recall, ENVI considers
> the 0,0 point of an image to be the upper left corner, while in IDL
> the default is lower left (which is !ORDER = 0).
>
> Hope that helps.
>
> Jeff
>
>
>
>
> David Fanning <david@dfanning.com> wrote in message news:<MPG.1aad6ce5e0f874479896c1@news.frii.com>...
>> Ananth Kini writes:
>>
>>> Thank you for the reply. But, I am still awaiting an answer for how to
>>> display this image. Example, using commands such as "TV".
>>>
>>> Though I used the "TV"command, I could not quite get the same visual
>>> effect as it had when the image was displayed in ENVI application.
>>> Could you tell me why this might be happening?
>>
>> I don't know. What kind of visual effect *did* you get?
>> Maybe it just needs to be scaled. Does TVSCL give you
>> a better effect than TV? ENVI sometimes applies some kind
>> of image "stretch" to the image before displaying it. Try
>> putting it in my XStretch program. Can you get it to look
>> like the image in ENVI?
>>
Re: Display ENVI image [message #38365 is a reply to message #38222] Tue, 02 March 2004 17:03 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ananth Kini writes:

> Would you be totally unavailable through summer 2004 ?

You line up a couple of tough tennis matches (preferably
with the over 50 crowd), and I'll be there. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: Display ENVI image [message #38366 is a reply to message #38291] Tue, 02 March 2004 16:49 Go to previous message
kini is currently offline  kini
Messages: 6
Registered: February 2004
Junior Member
Dear Dr. Fanning,

Fabulous ! TVSCL did the trick. You are right, I am a novice at IDL
(got into IDL programming just 2 months ago). I am a computer science
student, but co-incidentally, do not know much about image processing.
Just helping a professor prop up a raw application into a
user-friendly one, using widget programming etc.

I must also thank you for your progress bar utility, which was
incorporated just today. Would you be totally unavailable through
summer 2004 ?

Kind regards, Ananth Kini

____________________________________________________________ _____

Ananth Kini, Masters in Computer Science, Dept. of Computer Science
Harvey R. Bright Bldg, TAMU, College Station, TX 77843
#4302, College Main, Apt 319, Bryan, TX 77801, Phone : 979-260-1954
kini@tamu.edu, kiniananth@hotmail.com
http://students.cs.tamu.edu/auk3908/


David Fanning <david@dfanning.com> wrote in message news:<MPG.1aad9f9593d436319896c2@news.frii.com>...
> Kenneth P. Bowman writes:
>
>> Since I am reading this note in my apartment in Boulder, if he comes all
>> the way here, I'll just send him on to Fort Collins to sit at the feet
>> of the master. :-)
>
> My gosh, I've been trading e-mails with you all day,
> and you are in Boulder! We could probably solve this
> XVolume thing over a beer or two. :-)
>
> Cheers,
>
> David
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: NR__SVDFIT issue
Next Topic: HDF5 and IDL

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

Current Time: Wed Oct 08 13:42:54 PDT 2025

Total time taken to generate the page: 0.00527 seconds