image FLYOVER or OVERVIEW (zoom ability plus "hand" tool moving it) in macro

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

image FLYOVER or OVERVIEW (zoom ability plus "hand" tool moving it) in macro

rrmarino
Hello Everyone!

I deal with big images in my problem and I am very interested in automatically show details of different areas of it.

If I could implement in a macro a way of zooming the image and moving the zoom area around sequentially  so it covers the whole image, it would be great.

Users would just run the macro and sit back, the whole image , zoomed, would be shown to them.


Any ideas?

Zoom I know can be implemented according to http://imagej.588099.n2.nabble.com/Zooming-in-Macros-td3429998.html

Best Regards,

Rodrigo Marino
Reply | Threaded
Open this post in threaded view
|

Re: image FLYOVER or OVERVIEW (zoom ability plus "hand" tool moving it) in macro

Rasband, Wayne (NIH/NIMH) [E]
On Jan 12, 2012, at 4:19 AM, rrmarino wrote:

> Hello Everyone!
>
> I deal with big images in my problem and/* I am very interested in
> automatically show details of different areas of it./
> *
> If I could implement in a macro /*a way of zooming the image and moving the
> zoom area around sequentially  so it covers the whole image, it would be
> great.*/
>
> Users would just run the macro and sit back, the whole image , zoomed, would
> be shown to them.

You can do this sort of thing using JavaScript. To create an "Image Flyover" command, save the following script in the plugins folder as "Image_Flyover.js and run Help>Update Menus.

-wayne

  // JavaScript image flyover
  imp = IJ.getImage();
  width = imp.getWidth();
  height = imp.getHeight();
  ic = imp.getCanvas();
  ic.zoom100Percent();
  r = ic.getSrcRect();
  r.x = r.y = 0;
  while (r.x+r.width<width||r.y+r.height<height) {
     r.x +=1;
     if (r.x+r.width>width) {
        r.x = 0;
        r.y += r.height;
        if (r.y+r.height>height)
           r.y = height-r.height;
     }
     ic.setSourceRect(r);
     imp.draw();
     IJ.wait(5);
  }
Reply | Threaded
Open this post in threaded view
|

Re: image FLYOVER or OVERVIEW (zoom ability plus "hand" tool moving it) in macro

rrmarino
Dear Wayne,

It is my pleasure to be in contact with you! I am new to ImageJ and I wasn't aware that the main developer of the software is also an active member of the forum!. Your program is fantastic, definitely one of my top 5.

Thank you very much for your JavaScript.  If you don't mind reviewing it a little bit, the last row is being swept twice. Besides that, it is perfect, exactly what I was looking for.

My congratulations again.

Rodrigo Marino