Re: Obtain Pixel values in ENVI and report those to IDL [message #64126] |
Thu, 04 December 2008 10:27 |
jeffnettles4870
Messages: 111 Registered: October 2006
|
Senior Member |
|
|
On Dec 3, 4:33 pm, david.b.val...@gmail.com wrote:
> I need to obtain pixel values interactively, via my cursor in an ENVI
> displayed image and report those out to IDL so I can read them into
> the REGION_GROW routine. This may seem simple but I can’t figure it
> out.
>
> Thanks for your help.
> Dave
You could also use one of two options if you want to stick to using
ENVI displays:
If you want to have a routine that just gets the current coordinates
under the cursor, then operate on those coordinates only, then you
should probably use DISP_GET_LOCATION.
If you want a routine that continuously updates as the cursor is moved
around in the image display, then you will probably want to set up a
"user defined move" or "user defined motion" routine (i always forget
the difference between the two). See ENVI documentation for those,
they require a preference setting to work.
Jeff
|
|
|
Re: Obtain Pixel values in ENVI and report those to IDL [message #64129 is a reply to message #64126] |
Thu, 04 December 2008 07:33  |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
> I doubt very much this is going to work, except in a very
> narrow set of circumstances. To grow the region, you are
> going to have to know the value of the image at a particular
> location. In general, you can't obtain that kind of information
> from an image display (which, by necessity, is scaled into
> the range of 0 to 255 and usually rebinned to fit into a
> display window).
oops, you are right, I forgot to query the data...
in Envi, use ENVI_GET_DATA()
Jean
|
|
|
Re: Obtain Pixel values in ENVI and report those to IDL [message #64130 is a reply to message #64129] |
Thu, 04 December 2008 07:20  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jean H. writes:
> First, I doubt you are doing the right program "combination"... I
> believe you should either do everything within IDL (open an image,
> select the pixel, grow your region), or within Envi, by calling an IDL
> function... but transferring data back and forth is likely going to be
> a pain.
>
> For the first option, well, the degree of complexity depends on what is
> your data and your goal...
>
> ;Open your image
> openr, unit,image, /get_lun
> readu, unit, img
> close, unit & free_lun, unit
>
> ;display it
> tvimage, img
>
> ;select a pixel
> cursor,x,y
>
> ;grow your region and else!
I doubt very much this is going to work, except in a very
narrow set of circumstances. To grow the region, you are
going to have to know the value of the image at a particular
location. In general, you can't obtain that kind of information
from an image display (which, by necessity, is scaled into
the range of 0 to 255 and usually rebinned to fit into a
display window).
You could, for example, get the value of your image at a particular
location in the image by using a program such as IMGWIN:
http://www.dfanning.com/catalyst/imgwin.html
To do this absolutely accurately, you would have to display
the image full size:
IDL> ImgWin, image, /FULL_RESOLUTION
I really have no idea how to do this kind of thing in ENVI, but
the idea for IMGWIN was stolen from ENVI, so I presume a similar
thing is possible. :-)
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.")
|
|
|
Re: Obtain Pixel values in ENVI and report those to IDL [message #64131 is a reply to message #64130] |
Thu, 04 December 2008 06:39  |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
david.b.valdez@gmail.com wrote:
> I need to obtain pixel values interactively, via my cursor in an ENVI
> displayed image and report those out to IDL so I can read them into
> the REGION_GROW routine. This may seem simple but I can�t figure it
> out.
>
> Thanks for your help.
> Dave
Hi Dave,
ok, since no specialist have answered, here is a try.
First, I doubt you are doing the right program "combination"... I
believe you should either do everything within IDL (open an image,
select the pixel, grow your region), or within Envi, by calling an IDL
function... but transferring data back and forth is likely going to be
a pain.
For the first option, well, the degree of complexity depends on what is
your data and your goal...
;Open your image
openr, unit,image, /get_lun
readu, unit, img
close, unit & free_lun, unit
;display it
tvimage, img
;select a pixel
cursor,x,y
;grow your region and else!
---------
For the second option, read in Envi help under menu/item user values. It
tells you how to integrate an IDL program in Envi.
Your program would, I guess, be like
;select a pixel
cursor,x,y
;grow your region and else!
Hope this helps!
Jean
|
|
|