makePoint() to remove points from list

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

makePoint() to remove points from list

Thomas Eschner
Hello,

In a macro, I use
setKeyDown("shift"); makePoint(xact, yact); setKeyDown("none");
to add points to a multi-point selection. That works well.
When I try to remove a particular point by
if (selectionContains(xact, yact)) {
  setKeyDown("alt"); makePoint(xact, yact); setKeyDown("none");
}
this very point is not removed, but all others instead.
When I use that function directly from the multi-point selections menu, Alt-click does what it is supposed to do, i.e. removes the clicked-on point.

Any hints?

Kind regards,
Thomas


--
NEU: FreePhone - kostenlos mobil telefonieren und surfen!
Jetzt informieren: http://www.gmx.net/de/go/freephone
Reply | Threaded
Open this post in threaded view
|

Re: makePoint() to remove points from list

Rasband, Wayne (NIH/NIMH) [E]
On Apr 20, 2011, at 8:54 AM, Thomas Eschner wrote:

> Hello,
>
> In a macro, I use
> setKeyDown("shift"); makePoint(xact, yact); setKeyDown("none");
> to add points to a multi-point selection. That works well.
> When I try to remove a particular point by
> if (selectionContains(xact, yact)) {
>  setKeyDown("alt"); makePoint(xact, yact); setKeyDown("none");
> }
> this very point is not removed, but all others instead.
> When I use that function directly from the multi-point selections menu, Alt-click does what it is supposed to do, i.e. removes the clicked-on point.

This bug is fixed in the 1.45g1 daily build. There is an example macro at

    http://imagej.nih.gov/ij/macros/examples/MakePointDemo.txt

-wayne