Posted by
Rasband, Wayne (NIH/NIMH) [E] on
Jan 28, 2015; 11:59pm
URL: http://imagej.273.s1.nabble.com/Macro-Zoom-in-without-changing-window-size-tiled-display-tp5011359p5011360.html
> On Jan 28, 2015, at 3:49 PM, mattjackson <
[hidden email]> wrote:
>
> Hello,
>
> I'm having some difficulties with a macro. I'm trying to do something that
> should be quite easy, and I would appreciate some help (thank you in
> advance).
>
> The setup: I have a set of tiled fluorescence images. These are very large
> images (225 20X images of a well in a 96-well plate stitched together). I've
> identified nuclei via the particle analyzer, and they're arrayed in the ROI
> manager. I need to zoom in to each ROI on each channel so I can make calls
> of phenotype via a dialogue box, all of which is written.
>
> The problem: When zooming in to the ROI, the channel windows expand, and
> they are no longer tiled (I can only see a single channel at a time). Here's
> the script, as well as attempts to fix this.
The window will not expand if you run the Image>Zoom>To Selection command with the alt key down. Here is an example:
run("Blobs (25K)");
makeRectangle(113, 70, 37, 30);
setKeyDown("alt")
run("To Selection");
-wayne
> Script 1: There's a for loop here (index i) looping over the ROIs
>
> selectWindow("Stitched_DAPI.tif");
> roiManager("select",i);
> run("To Selection");
> run("Out [-]");
> run("Out [-]");
> run("Out [-]");
> run("Out [-]");
> run("Out [-]");
> run("Out [-]");
> run("Out [-]");
> run("Out [-]");
> run("Out [-]");
>
> Script 2: Tried to define the window size with a rectangle selection and
> zoom into that. The rectangle was near the ROI but not overlaying. There's
> some error there, but the windows still expand.
>
> selectWindow("Stitched_DAPI.tif");
> roiManager("select",i);
> Roi.getCoordinates(xroi, yroi);
> Array.getStatistics(xroi, xmin, xmax);
> Array.getStatistics(yroi, ymin, ymax);
> xcenter = (xmax - xmin)/2 + xmin;
> ycenter = (ymax - ymin)/2 + ymin;
> recx = xcenter - 230;
> recy = ycenter + 260;
> makeRectangle(recx, recy, 460, 520);
> run("To Selection");
>
> Further attempts: Tried to trick ImageJ by moving the window off screen (to
> negative X,Y values) and then do the zooming, but the window still expanded.
> Also, running Tile again doesn't work because it zooms the image out again.
>
> Anybody have an idea how to accomplish this in an ImageJ macro?
>
> Thanks,
> Matt Jackson
>
>
>
>
> --
> View this message in context:
http://imagej.1557.x6.nabble.com/Macro-Zoom-in-without-changing-window-size-tiled-display-tp5011359.html> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html