Login  Register

Re: Which Image

Posted by Sullivan, Michael J (College of Med.) on Dec 21, 2005; 4:26pm
URL: http://imagej.273.s1.nabble.com/Which-Image-tp3704187p3704191.html

Wayne, Bob, Thanks for the responses. But I don't know which image/canvas the mouse event was triggered from; the mouse listener does not seem to be unique to the canvas.

        // "this" is the class from which the images are opened.
    preImageCanvas.addMouseListener(this);
    postImageCanvas.addMouseListener(this);

I thought a "focus" test would work but it doesn't or I'm testing the wrong thing

--- Mike

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Wayne Rasband
Sent: Tuesday, December 20, 2005 5:47 PM
To: [hidden email]
Subject: Re: Which Image

> hay All! I'm writing a plugin that will have two open images.  The two
> images have the same filename from different folders.  I want to
> trigger an action (roiSave) off of the mouse release that occurs after
> the drawing of the ROI.  How can I identify which image I'm in? Any
> ideas appreciated -
> -- Mike

In a macro:

    dir = getDirectory("image");

In a plugin:

     String dir = IJ.getDirectory("image");

-wayne