Login  Register

Re: Move active window to back

Posted by Peterbauer Thomas on Mar 15, 2015; 7:42pm
URL: http://imagej.273.s1.nabble.com/Move-active-window-to-back-tp5011971p5011972.html

On 2015-03-15 19:45, Matt Pearson wrote:
> In a macro, if I have a number of images open, how can i move the active image to the back?

run("Put Behind [tab]");

More specific handling of image windows is possible. Each open image has
a unique identifier (a negative number), which you can retrieve from the
active image with:

id = getImageID();

To get an array with all IDs, you can loop over the open images:

imageIDs=newArray(nImages);
for (i=1; i<=nImages; i++) {
     selectImage(i); //positive number activates the i-th image
     imageIDs[i-1]=getImageID(); //array starts with index 0
}

for (i=0; i<imageIDs.length; i++) {
     print(imageIDs[i]);
}

With the stored IDs, you can later use the following commands:

selectImage(id);
isActive(id);
isOpen(id);

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html