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

Home » Public Forums » archive » Re: chosing points along an image row with mouse
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: chosing points along an image row with mouse [message #25552] Tue, 26 June 2001 21:07
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
Kim Nielsen writes:

> I would like to know if there is a way to get the mouse to only move
> along a row (or column). I have an image and need to pick two points
> along the same row. Is there a way to get the mouse only to move along
> a row ?

You can look at an example like ZPLOT to see
a widget program that draws an arrow along
the initially selected row. This is not the
best program I've ever written, and I write
my event handlers differently now, but it will
give you a place to start anyway. I'm working
with a plot, but you will get the idea I think.
It is much simpler with an image.

You will need these two old programs:

http://www.dfanning.com/programs/zplot.pro
http://www.dfanning.com/programs/getcolor.pro

(ZPLOT allows you to zoom into a line plot.
The arrow is used to show you the extend of the
plot you will be zooming.)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: chosing points along an image row with mouse [message #25554 is a reply to message #25552] Tue, 26 June 2001 15:28 Go to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Kim Nielsen wrote:
>
> Hi,
>
> I would like to know if there is a way to get the mouse to only move
> along a row (or column). I have an image and need to pick two points
> along the same row. Is there a way to get the mouse only to move along
> a row ?

why do you want to get the mouse to only to move along a row when what you *really* want
is to pick two points along the same row? :o)

After you have selected row(or column) "mode" in your program (widget button or function
keyword?), the first mouse button click can retrieve the image value at that position, as
well as save the current row(or column) image pixel value, say ysave(or xsave). The next
mouse click at (x,y) will then cause your program to read the image at position (x, ysave)
in row mode or (xsave, y) in column mode. A neato thing would be to turn on a
horizontal(or vertical) bar the width(or height) of your image after the first mouse click
that then moves vertically(or horizontally) as you move the mouse.

I think that this would work (or not :o) with the (gasp!) cursor command too but, despite
the code outlay, a widget approach would be cleaner (and easier too I reckon but YMMV).

paulv

--
Paul van Delst A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP Drink deep, or taste not the Pierian spring;
Ph: (301)763-8000 x7274 There shallow draughts intoxicate the brain,
Fax:(301)763-8545 And drinking largely sobers us again.
Alexander Pope.
Re: chosing points along an image row with mouse [message #25555 is a reply to message #25554] Tue, 26 June 2001 15:46 Go to previous message
tandp is currently offline  tandp
Messages: 8
Registered: November 2000
Junior Member
In article <68702482.0106261407.4ee5a51d@posting.google.com>,
ftksn1@aurora.alaska.edu (Kim Nielsen) wrote:

> Hi,
>
> I would like to know if there is a way to get the mouse to only move
> along a row (or column). I have an image and need to pick two points
> along the same row. Is there a way to get the mouse only to move along
> a row ?
>
> thanks,
> Kim

Use "cursor, x, y" or the equivalent mouse event values if you're in a
draw widget and ignore either the first or second y values that are
returned.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: svd experts?
Next Topic: IDL and 'nice' question

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

Current Time: Wed Oct 08 15:13:02 PDT 2025

Total time taken to generate the page: 0.00585 seconds