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

Home » Public Forums » archive » Re: collecting points with "cursor" procedure for several classes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: collecting points with "cursor" procedure for several classes [message #43503] Mon, 18 April 2005 09:08
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Francois L. writes:

> Does someone has an idea on how to collect samples for several classes with
> the CURSOR procedure ?
> The problem is using a loop of the type while...
>
> For example, if I have 3 targets of interest and I want to collect several
> points for each target, I can think about the following pseudo-code:
> number_of_targets = 3
> tvscl, image
> for i=0, number_of_targets-1 do begin
> while (not finish cliking) do begin
> cursor, x,y, device
> xyouts, x, y, '+', /device
> endwhile
> endfor
>
> I am interested in keeping only pixels coordinates of samples.
> I know how to do it with xroi procedure but this one allows only to collect
> polygons.
>
> If the image is displayed, for one class, I would like to click on several
> samples and stop by clicking the right button of the mouse.
> This right-click would be the stop condition of the while loop.
> But how to code this ?

You would do it like this:

number_of_targets = 3
tvscl, image
targets = 0
!Mouse = 0
while (!Mouse NE 4) AND (targets LE number_of_targets) do begin
cursor, x,y, /device, /down
xyouts, x, y, '+', /device
targets = targets + 1
endwhile

But you *really* don't want to do this with the CURSOR command. :-)

Learn to write a widget program. You will have *infinitely* more
flexibility.

http://www.dfanning.com/widget_tips/line_on_image.html

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Previous Topic: collecting points with "cursor" procedure for several classes
Next Topic: Re: My Last Post Here

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

Current Time: Wed Oct 08 19:56:28 PDT 2025

Total time taken to generate the page: 0.00358 seconds