Using themagnifying glass without Toolbar

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

Using themagnifying glass without Toolbar

Cspr
Hey fellow ImageJ users,

is it possible to use the magnifying glass functionality in ImageJ, with no Toolbar present in the program?

Attempts such as

IJ.run("Set... ", "zoom=200");
IJ.run("In", "");

and the likes does zoom, but i can't zoom out again, nor can I zoom in on the parts I would like to using the mouse. Bascially is it possible to get the same functionality as the magnifying glass on the imagej toolbar, where I can zoom in and out using the mouse and its buttons? If so how?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Using themagnifying glass without Toolbar

Jim Passmore
Cspr,

A couple options might be:

macro language setTool command
http://rsb.info.nih.gov/ij/developer/macro/functions.html

or check out the Toolbar.setTool in the Java api documentation
http://rsb.info.nih.gov/ij/developer/api/index.html

Both of these links are invaluable!!!

Jim

----------------------------------------------
Jim Passmore
Research Associate
Sealed Air Corporation
----------------------------------------------






ImageJ Interest Group <[hidden email]> wrote on 03/05/2010 08:12:34
AM:

> Hey fellow ImageJ users,
>
> is it possible to use the magnifying glass functionality in ImageJ, with
no
> Toolbar present in the program?
>
> Attempts such as
>
> IJ.run("Set... ", "zoom=200");
> IJ.run("In", "");
>
> and the likes does zoom, but i can't zoom out again, nor can I zoom in
on
> the parts I would like to using the mouse. Bascially is it possible to
get
> the same functionality as the magnifying glass on the imagej toolbar,
where
> I can zoom in and out using the mouse and its buttons? If so how?
>
> Thanks
>
> --
> View this message in context: http://n2.nabble.com/Using-
> themagnifying-glass-without-Toolbar-tp4680649p4680649.html
> Sent from the ImageJ mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Using themagnifying glass without Toolbar

BenTupper
In reply to this post by Cspr
Hello,

Have you checked out the documentation on zooming? Maybe that has the  
answer you are looking for.

http://rsb.info.nih.gov/ij/docs/menus/image.html#zoom

Cheers,
Ben

On Mar 5, 2010, at 8:12 AM, Cspr wrote:

> Hey fellow ImageJ users,
>
> is it possible to use the magnifying glass functionality in ImageJ,  
> with no
> Toolbar present in the program?
>
> Attempts such as
>
> IJ.run("Set... ", "zoom=200");
> IJ.run("In", "");
>
> and the likes does zoom, but i can't zoom out again, nor can I zoom  
> in on
> the parts I would like to using the mouse. Bascially is it possible  
> to get
> the same functionality as the magnifying glass on the imagej  
> toolbar, where
> I can zoom in and out using the mouse and its buttons? If so how?
>
> Thanks
>
> --
> View this message in context: http://n2.nabble.com/Using-themagnifying-glass-without-Toolbar-tp4680649p4680649.html
> Sent from the ImageJ mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Using themagnifying glass without Toolbar

Bill Mohler
In reply to this post by Cspr
The closest I can come up with is to point the mouse at your point of
interest, and zoom in and out with + and - .   Once zoomed, you can pan
by holding down the spacebar and dragging the canvas.  Seems to cover
all you want, with no toolbar interaction.  But it's not mouse-only.

Bill

Cspr wrote:

> Hey fellow ImageJ users,
>
> is it possible to use the magnifying glass functionality in ImageJ, with no
> Toolbar present in the program?
>
> Attempts such as
>
> IJ.run("Set... ", "zoom=200");
> IJ.run("In", "");
>
> and the likes does zoom, but i can't zoom out again, nor can I zoom in on
> the parts I would like to using the mouse. Bascially is it possible to get
> the same functionality as the magnifying glass on the imagej toolbar, where
> I can zoom in and out using the mouse and its buttons? If so how?
>
> Thanks
>
>  
Reply | Threaded
Open this post in threaded view
|

Re: Using themagnifying glass without Toolbar

Cspr
In reply to this post by Jim Passmore
Thanks for the suggestions.

setTool does not work when no toolbar is present, and no toolbar is in fact present in the program i'm writing.

Its very possible to use the zoom class in imageJ, but simply calling "in" as the argument to the run function i.e.

zf.run("in");

does zoom but zooms pretty much whereever it pleases.

Bill:
Your suggestion was the first thing I tried before posting, but moving my mouse over the image of interest (after my program has gone to work on it) and pressing the zoom-keys does not work.
Reply | Threaded
Open this post in threaded view
|

Re: Using themagnifying glass without Toolbar

Gluender-3
Anonymous,

you may consider zoom to selection and of course first make a selection.

You may try the UI or macro routines before asking.


>Thanks for the suggestions.
>
>setTool does not work when no toolbar is present, and no toolbar is in fact
>present in the program i'm writing.
>
>Its very possible to use the zoom class in imageJ, but simply calling "in"
>as the argument to the run function i.e.
>
>zf.run("in");
>
>does zoom but zooms pretty much whereever it pleases.
>
>Bill:
>Your suggestion was the first thing I tried before posting, but moving my
>mouse over the image of interest (after my program has gone to work on it)
>and pressing the zoom-keys does not work.
>--
>View this message in context:
>http://n2.nabble.com/Using-themagnifying-glass-without-Toolbar-tp4680649p4681138.html
>Sent from the ImageJ mailing list archive at Nabble.com.

HTH
--

                   Herbie

          ------------------------
          <http://www.gluender.de>
Reply | Threaded
Open this post in threaded view
|

Re: Using themagnifying glass without Toolbar

Cspr
I have tried the routines already. The purpose of the question was to know whether the button "magnifying glass" in ImageJ could be applied through a macro call to an image in my code , or its functionality be applied through some other means.

"Zoom in" for instance would be adequate if you could then pan the image around within the window but no macro call seems to be able to do that.

The question still stands though.
Reply | Threaded
Open this post in threaded view
|

Re: Using themagnifying glass without Toolbar

Michael Schmid
Hi Cspr,

In a macro, I think there is no possibility to scroll the image, so  
you can't  zoom in at the mouse position.

In a plugin you can do it:
The plugin cald register as MouseListener of the ImageCanvas. On a  
mouse click, it cald call the zoomIn method of the ImageCanvas.
Have a look at the WindowManager (for determining the foreground  
window), ImagePlus, ImageWindow and ImageCanvas classes.

Michael
________________________________________________________________

On 5 Mar 2010, at 17:38, Cspr wrote:

> I have tried the routines already. The purpose of the question was  
> to know
> whether the button "magnifying glass" in ImageJ could be applied  
> through a
> macro call to an image in my code , or its functionality be applied  
> through
> some other means.
>
> "Zoom in" for instance would be adequate if you could then pan the  
> image
> around within the window but no macro call seems to be able to do  
> that.
>
> The question still stands though.
Reply | Threaded
Open this post in threaded view
|

Re: Using themagnifying glass without Toolbar

Gluender-3
In reply to this post by Cspr
>I have tried the routines already. The purpose of the question was to know
>whether the button "magnifying glass" in ImageJ could be applied through a
>macro call to an image in my code , or its functionality be applied through
>some other means.

Let your macro make a point selection at the zoom center and then let
the macro call "zoom to selection".

>"Zoom in" for instance would be adequate if you could then pan the image
>around within the window but no macro call seems to be able to do that.

Panning is a new aspect, that you didn't mention before...

>The question still stands though.

As others have stated and AFAIK a mouse click for defining the center
of zoom is not implemented. Of course you may try to implement it. I
propose to consider "zoom to selection" and perhaps the corresponding
Java code may help implementing the desired functionality.

Best
--

                   Herbie

          ------------------------
          <http://www.gluender.de>
Reply | Threaded
Open this post in threaded view
|

Re: Using themagnifying glass without Toolbar

Cspr
No, panning was not mentioned is was a spur of the moment thought that got incorporated. Perhaps it's possible to "spawn" the original imageJ toolbad inside the program and then call
IJ.setTool("zoom");

Anyone have a clue on that?