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

Home » Public Forums » archive » Re: ENVI: procedure to get X, Y of pixel in displayed 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
Re: ENVI: procedure to get X, Y of pixel in displayed image [message #52077] Sat, 30 December 2006 02:35
Mort Canty is currently offline  Mort Canty
Messages: 134
Registered: March 2003
Senior Member
Absolutely. He should look at

"User Defined Motion Routine"

in the ENVI System Preferences dialog.

Cheers

Mort


David Fanning schrieb:

> To make this work, you pretty much have to have a
> way to translate from the window coordinate system
> to the image coordinate system. I don't know ENVI,
> so I am not sure how this is done there. But I should
> think this is such a fundamental property of the way
> ENVI *must* handle images that your efforts would be
> more handsomely rewarded by searching the ENVI documentation
> than by trying to write an IDL program to do it.
>
> Cheers,
>
> David
Re: ENVI: procedure to get X, Y of pixel in displayed image [message #52086 is a reply to message #52077] Wed, 27 December 2006 06:53 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
aberte@gmail.com writes:

> i'm getting troubled with writing a procedure to get x,y (so: y = the
> line of the image (row) and x = the sample (column)) coordinates of a
> pixel of a displayed image. I'm trying to do this with cursor, but
> while debugging I don't have the results I want.
>
> I'm using
>
> cursor, x, y, 4, /DATA
>
> I saw that with
> cursor, x, y, 4, /DEVICE
> I get integers instead of floats.
>
> I would to like what I'm doing wrong.

Probably several things. :-)

First of all, you shouldn't be using the CURSOR command
in a widget window. You will probably get *slightly*
wrong values, even if you do everything else right. You
should trap button events from the draw widget in an
event handler.

But even if this CURSOR command worked like you expected
it to, the chances of this doing the right thing are
small, since it would *only* work if there was a one-to-one
correspondence between the size of the window and the
physical size of the image. I think we can assume in a
program like ENVI this will seldom be the case.

To make this work, you pretty much have to have a
way to translate from the window coordinate system
to the image coordinate system. I don't know ENVI,
so I am not sure how this is done there. But I should
think this is such a fundamental property of the way
ENVI *must* handle images that your efforts would be
more handsomely rewarded by searching the ENVI documentation
than by trying to write an IDL program to do it.

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: ENVI: procedure to get X, Y of pixel in displayed image [message #52087 is a reply to message #52086] Wed, 27 December 2006 06:50 Go to previous message
aberte@gmail.com is currently offline  aberte@gmail.com
Messages: 8
Registered: December 2006
Junior Member
I need something like "Cursor Location / Value" programm available in
Envi.

Does anybody know about the code? Thank you again

On Dec 27, 12:08 pm, "abe...@gmail.com" <abe...@gmail.com> wrote:
> Hi,
> i'm getting troubled with writing a procedure to get x,y (so: y = the
> line of the image (row) and x = the sample (column)) coordinates of a
> pixel of a displayed image. I'm trying to do this with cursor, but
> while debugging I don't have the results I want.
>
> I'm using
>
> cursor, x, y, 4, /DATA
>
> I saw that with
> cursor, x, y, 4, /DEVICE
> I get integers instead of floats.
>
> I would to like what I'm doing wrong.
> Also, I would to know if somebody have written a procedure to get
> coordinates and value of a pixel by clicking on it on the display.
>
> Thank you.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Number of points inside a contour curve
Next Topic: Using value_locate with a non-monotonic vector! And it's working!??!

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

Current Time: Wed Oct 08 20:00:59 PDT 2025

Total time taken to generate the page: 0.03494 seconds