Login  Register

Re: automatic point tool?

Posted by jmutterer on Jul 30, 2009; 1:49pm
URL: http://imagej.273.s1.nabble.com/automatic-point-tool-tp3691628p3691629.html

On Wed, Jul 29, 2009 at 11:37 AM, Mendoza Rodriguez wrote:

> I'd like to follow the movement of a given object across time (and the
> stack), and get the coordinates of the mouse pointer without clicking.


The following tool macro does this.


macro 'oneClickTracker Tool - C000T3f181' {
  getCursorLoc(x, y, z, modifiers);
  while(modifiers&16!=0) {
    wait(1000);
    getCursorLoc(x, y, z, modifiers);
    if ((x==-1)&&(y==-1)) {x=xs;y=ys;}
    if (!isKeyDown('shift')) setKeyDown('shift');
    makePoint(x,y);
    xs=x;ys=y;
    if (z+1==nSlices) exit();
    else run("Next Slice [>]");
  }
}
//

Sincerely,
Jerome.