IJ2 is out
 Sec. 30: Analyze Up Part V: Menu Commands Sec. 32: Window



This submenu contains commands for installing, running and recording macros, as well as any macro commands added by PluginsMacrosInstall…↓ Macros contained in a file named StartupMacros.txt, in the macros folder, are automatically added to this submenu when ImageJ starts up. By design, only one set of macros can be installed at a time. As such, the last set of macros installed by PluginsMacrosInstall…↓ (or by the More Tools Menu↑) will always replace previously installed macros.


Adds one or more macros contained in a file to the bottom of this submenu. To install a set of macros, and at the same time view their source code, open the macro file with FileOpen and use Editor↑’s MacrosInstall Macros command. Macros in the file ImageJ/macros/StartupMacros.txt are automatically installed when ImageJ starts up. Similarly, with ImageJ 1.44f and later, newly opened macro sets with two or more macros are also automatically installed in this menu.


Loads and runs a macro without opening it in Editor↑. To run a macro, and at the same time view its source code, open it with FileOpen and use the editor’s MacrosRun Macro command.

31.1.3Startup Macros…

Opens ImageJ/macros/StartupMacros.txt. The same file can be opened by holding Shift while selecting Startup Macros from the figure images/tools/Switcher.png   drop-down menu (see More Tools Menu↑).


Opens the ImageJ command recorder. To create a macro, open the recorder, use one or more ImageJ commands, then click Create. When the recorder is open, each menu command you use generates a macro run() function call. The run() function has one or two string arguments. The first is the command name. The optional second argument contains dialog box parameters. Examples:
figure images/Recorder.png
Note that you can interact with the recorder window by deleting or commenting lines of code or pasting text from Editor↑. This may be specially useful when writing your own macros or to generate simple ‘Session Logs’. In this case, you would start the Recorder and let ImageJ keep track of the performed actions by generating macro code.


This submenu contains commands for creating keyboard shortcuts and for installing and removing plugins.

31.2.1List Shortcuts…

figure images/ListShortcuts.png
This command generates a table with the ImageJ keyboard shortcuts in one column and the commands they call in another. Commands prefixed by ‘ * ’ refer to shortcuts created with Create Shortcuts…↓ while commands prefixed by ‘ ^ ’ refer to installed macros (listed in PluginsMacros) and override ImageJ default hot-keys.
Note that unless Require control key for shortcuts in EditOptionsMisc…↑ is checked, you do not have to hold down Ctrl to use a keyboard shortcut . E.g., to open an image (FileOpen… [o]↑) simply press O.

31.2.2Create Shortcuts…

figure images/CreateShortcut.png
Assigns a keyboard shortcut to an ImageJ menu command and lists the shortcut in the Shortcuts submenu.
Select the command from the popup menu and enter the shortcut in the text field. A shortcut can be a lower or uppercase letter or ‘F1’ through ‘F12’. Use PluginsUtilitiesList Shortcuts…↑ to get a list of shortcuts that are already in use.

31.2.3Install Plugin…

figure images/InstallPlugin.png
Installs a plugin in a user-specified submenu. Plugins with a showAbout() method are also automatically added to the HelpAbout Plugins submenu.
Use the first popup menu to select the plugin and the second to select the submenu it is to installed in. The command must be different from any existing ImageJ command. Shortcut (optional) must be a single letter or ‘F1’ through ‘F12’. Argument (optional) is the string that will passed to the plugin’s run method.


Removes commands added to the Shortcuts submenu by Create Shortcuts…↑ Also removes commands added by Install Plugin…↑ and removes plugins installed in the Plugins menu. The menus are not updated until ImageJ is restarted.


31.3.1Control Panel… [U]

figure images/ControlPanel.png
This command [47] opens a window containing ImageJ commands in a hierarchical tree structure. Click on a leaf node to launch the corresponding ImageJ command (or plugin). Double click on a tree branch node (folder) to expand or collapse it. Click and drag on a tree branch node (folder) to display its descendants in a separate (child) window. In a child window, click on ‘Show Parent’ to re-open the parent window.

31.3.2Find Commands… [l]

figure images/CommandFinder.png
The quickest way to find a command without having to navigate through all the menus [48].
Evoke the prompt by pressing  L (as in ‘command Launcher’, or ‘Locator’). If you type part of a command name, the list will only show commands that match that substring. If only a single command matches then that command can be run by pressing Enter.
If multiple commands match, click with the mouse to select a command to run. Alternatively pressing the up or down keys will move keyboard focus to the list and the selected command can be run by pressing Enter. Pressing Backspace switches focus back to the prompt. Double clicking on a command will run that command. Pressing Esc closes the window.
Show full information If checked, the Command Finder will display the location of the listed menu entries.
Fuzzy matching (Fiji only) Activates approximate string matching. Useful if you are not sure about the command spelling.
Close when running If checked, the Command Finder will dismiss after choosing Run or pressing Enter.
ExportPrints the filtered list of commands to an ImageJ table.


figure images/Search.png
Searches for macros (.txt, .ijm), scripts (.js, .py, .rb, .clj, .bsh), plugins source (.java) and .html files containing a particular string.
Search is performed recursively (subdirectories are included) and results displayed in the Log Window↑. In the Log window, double click on a file path to have it open.
Search contents Specifies if the search should be restricted to filenames or extended to file contents. If checked, the line number where the string was found is displayed.
Ignore case Specifies if the search should be case-insensitive.
Search macros folder Extends the search scope to ImageJ/macros/.
Search plugins folder Extends the search scope to ImageJ/plugins/.
Search scripts folder Extends the search scope to ImageJ/scripts/ (if present).
Search source folder Extends the search scope to ImageJ/source/(if present). Requires the ImageJ source code to be downloaded from ../../download/src/ and extracted into the ImageJ folder.
Note that you can perform searches in other directories by choosing none of the folders above mentioned. In this case, you will be asked to choose a target directory on a second dialog prompt.
Search.txt, the macro in ij.jar implementing this command, Find Commands… [l]↑, Finding Commands↑

31.3.4Monitor Events…

By implementing the IJEventListener, CommandListener and ImageLister interfaces, this command is able to monitor foreground and background color changes, tool switches, Log window closings, command executions and image window openings, closings and updates.
Debug mode (EditOptionsMisc…↑)

31.3.5Monitor Memory…

figure images/Memory.png
Displays a continuously updated graph of ImageJ’s memory utilization, which can be useful for detecting memory leaks.
Memory usage and running threads are displayed above the graph. As for the IJ Status bar↑, clicking on the window will reclaim unused memory by running the Java garbage collector.
Ideally you should be able to open several images, process them, close them, and the amount of memory used will be the same as when you started.
EditOptionsMemory & Threads…↑

31.3.6Capture Screen [g]

Copies the screen to an RGB image and displays that image in a new window. Holding Ctrl Shift G will capture the screen while a modal dialog box is active if the dialog is based on ImageJ’s GenericDialog class.

31.3.7Capture Image

Copies a WYSIWYG version of active image to an RGB image and displays that image a new window.

31.3.8ImageJ Properties…

This command displays various ImageJ properties (Java version, OS[?] name and version, path separator, location of directories, screen size, etc.) in a text window. Holding Alt lists all Java properties


This command lists, in a text window, the currently running threads and their priorities.


Runs 62 image processing operations on the current image and displays the elapsed time in the ImageJ status bar. Additional benchmarks, test results, and source code are available in the Benchmarks package of plugins.


figure images/Reset.png
Use this command to unlock a locked Image, or to reclaim memory used by the clipboard and undo buffers (cf. Undo and Redo↑).


This submenu contains commands opening editor windows that can be used to edit and run macros, scripts and plugins. It also has a command that opens a text window of a specified size and a command that opens a table that macros can write to. The editor windows opened by Plugin, Plugin Filter and Plugin Frame contain prototype Java code for the three types of plugins supported by ImageJ.


Opens a blank editor window with the title ‘Macro.txt’.

31.4.2Macro Tool

Opens Macro_Tool.txt, an example macro tool that creates circular selections.


Opens a blank editor window with the title ‘Script.js’.


Opens an editor window containing a prototype plugin that implements the PlugIn interface. Plugins of this type open, capture or generate images. The prototype displays Hello world!. Press Ctrl R (FileRun Macro) to compile and run it. Note that the name you choose for the plugin should include at least one underscore. Another example is the Step Maker plugin.

31.4.5Plugin Filter

Opens an editor window containing a prototype plugin that implements the PlugInFilter interface. Plugins of this type process the active image. The prototype inverts the active image twice. Another example is the Image Inverter.

31.4.6Plugin Frame

Opens an editor window containing a prototype plugin that extends the PlugInFrame class. Plugins of this type displays a window containing controls such as buttons and sliders. The prototype opens a window containing a text area. Another example is the IP Demo plugin.

31.4.7Plugin Tool

Opens a prototype plugin tool, demonstrating ij.plugin.tool.PlugInTool [49]. A plugin tool is a Java plugin that installs in the ImageJ toolbar to interact with the image canvas (see Custom Tools). Plugin tools with names ending in Tool are listed on the More Tools Menu↑ if placed in the ImageJ/plugins/Tools/ directory.

31.4.8Text Window…

figure images/NewTextWindow.png
Opens a text window of a specified size that macros can write to. PrintToTextWindow, Clock and ProgressBar are examples of macros that write to a text window.
PluginsNewMacro↑, FileNewText Window [N]↑


figure images/NewTable.png
Opens a blank table, similar to the Results table, that macros can write to. SineCosineTable2 is an example of such a macro.
PluginsNewText Window…↑

31.5Compile and Run…

Compiles and runs a plugin. Runs a plugin if the name of the selected file ends in .class. Requires that ImageJ be running on a Java Virtual Machine that includes the javac compiler, which is contained in the Tools.jar archive. Tools.jar is included with the Windows and Linux versions of ImageJ bundled with Java, and it is pre-installed on Mac OS X. Troubleshooting information can be found under ‘Compiling Plugins’ in the Linux and Windows release notes.
The EditOptionsCompiler…↑ command can be used to configure the javac compiler. Since ImageJ 1.44c and later, Compile and Run…↑ adds the Bio-Formats plugin (loci_tools.jar) to the Java compiler’s classpath.

 Sec. 30: Analyze Up Part V: Menu Commands Sec. 32: Window