Re: ENVI: procedure to get X, Y of pixel in displayed image [message #52077] |
Sat, 30 December 2006 02:35 |
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  |
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  |
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.
|
|
|