Detect when Polygon closed

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Detect when Polygon closed

mdhiggins
Hello,

I am writing a macro to outline crystals in an image.

The user outlines the crystal with the polygon tool. Then I want a message to pop up then asking if the outline is correct. This is what I have tried. However, I can't work out how to determine when the user has closed the polygon and the message should pop up.

do
{
setTool("polygon");

// something is needed here to show when polygon is closed by user.

outline_OK = getBoolean("Is outline correct?");

}
while (outline_OK==false) ;

Cheers  Michael

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Detect when Polygon closed

George Patterson
Micheal,
Maybe you could just use
waitForUser("Please draw your polygon and click OK");
George

On Sat, Aug 15, 2015 at 10:43 AM, Michael Higgins <[hidden email]> wrote:

> Hello,
>
> I am writing a macro to outline crystals in an image.
>
> The user outlines the crystal with the polygon tool. Then I want a message
> to pop up then asking if the outline is correct. This is what I have tried.
> However, I can't work out how to determine when the user has closed the
> polygon and the message should pop up.
>
> do
> {
> setTool("polygon");
>
> // something is needed here to show when polygon is closed by user.
>
> outline_OK = getBoolean("Is outline correct?");
>
> }
> while (outline_OK==false) ;
>
> Cheers  Michael
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html