is it possible to set image window dimensions via call() command in macro language?

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

is it possible to set image window dimensions via call() command in macro language?

Mark R. Besonen
Hello all,

        While macro-limited folks can control the location of an image
window using setLocation(), it is very hard to control the actual
size/dimensions of such a window because ImageJ does that
automatically depending on the window's location, magnification,
etc.  For example, when you zoom in, an image window will increase in
dimensions until you get to a magnification at which the increased
window size would fall off screen.  At that point, the window
size/dimensions will not actually increase--instead, the window will
stay a fixed size while the magnification increases, and you'll have
to pan around the window to actually see all of the image.  You can
manually change the window dimensions at this point by dragging the
window edges or corner as necessary, so it is not that the window
dimensions are actually locked, they just follow ImageJ's internal
algorithm for calculating window size/position.

        Anyway, with some creative macro'ing, I've dealt with this in the
past--for example, I'd use setLocation() to move a window to
"negative" screen coordinates as necessary, do my zooming in/out
while ImageJ automatically controls the window dimensions, and then
use setLocation() again to move the window back on screen.  However,
this is extremely laborious, and doesn't always provide a
satisfactory solution.

        This morning I was investigating using the call() command and hoping
to figure out the appropriate Java method+class syntax to directly
control the size/dimensions of a window.  My guess is that it is
somewhere along the lines of ij.gui.ImageWindow..., but alas, I just
could not get my brain around it, and still don't know if it is even possible.

        Could somebody more skilled than I comment on this?  Would it be
possible using the call() command to directly control the
size/dimensions of an image window?  If so, could you provide the
appropriate syntax?  Location is not a problem as we already have
setLocation().

        Thanks in advance for your help!

Mark Besonen
UMass Geosciences