Getting cursor location upon mouse click...

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

Getting cursor location upon mouse click...

Mark McNabb
Hi if anyone could help me on this that would be great!

I am trying to set up a macro in order to analyse iem gold labeled
micrographs.  What I need to do is click on a location in an image, and then
have the x,y value of the cursor at the time of the mouse click be put into
an x,y variable pair in the macro.

I have seen the mouse-listener plugin but don't know if that is appropriate
or how to use it in a macro.

Any ideas?

Thank you!

Mark.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting cursor location upon mouse click...

Wayne Rasband
> I am trying to set up a macro in order to analyse iem gold
> labeled micrographs.  What I need to do is click on a
> location in an image, and then have the x,y value of the
> cursor at the time of the mouse click be put into an x,y
> variable pair in the macro.
>
> I have seen the mouse-listener plugin but don't know if that
> is appropriate or how to use it in a macro.

Use a tool macro. Here is an example:

    macro "Color Picker Tool -C44f-o4499" {
         getCursorLoc(x, y, z, flags);
         print(x, y, z, getPixel(x,y));
    }

More information about tool macros can be found at:

      http://rsb.info.nih.gov/ij/developer/macro/macros.html#tools

-wayne
Loading...