Dispose All Windows: ImageJ plugin

 

Dispose_All_Windows.jar (compiled plugin)

Dispose_All_Windows.java (source code)

This ImageJ plugin closes all image windows and non-image windows as selected by the user. The code is based on the Dispose_All_Windows plugin by Tony Collins and J. Anthony Parker. In this updated version, multiple subsequent dialog screens are displayed in case the available space on monitor won’t be large enough for listing the titles of all open image windows. If the plugin is started while <Shift> or <Alt> key being pressed, all images and/or non-image windows can be selected at once.

If the plugin is called from the Macro executor with options set, it will dispose without confirmation any image and non-image windows as specified (regardless if it is locked or changes are not saved.)

Macro examples:

run("Dispose All Windows", "image_1.tif image_2.tif Exception");

disposes the specified windows(which could be either the title of images like in this example “image_1.tif”, and/or titles of non-image windows like, in this example, the title of the text window “Exeption”). Note that spaces in window names have to be replaced by underscores. If there are two windows with the same (space to underscore replaced) title, add an underscore for referring the second one. Window names that do not match with existing windows will be ignored.

run("Dispose All Windows", "/all image")

dispose all image windows (without confirmation!)

run("Dispose All Windows", "/all non-image");

automatically dispose all non-image windows

run("Dispose All Windows", "/all image non-image");

automatically dispose all image and non-image windows

run("Dispose All Windows");

show the user dialog (window disposing upon confirmation)

The main plugin features should work with all common versions of ImageJ. The optional functionality of closing non-image windows requires ImageJ version 1.40 or newer.

Fixed and updated Jan 5, 2013 by Albrecht Sigler.