Hide
IJ2 is out
 Sec. 24: Log Window Up Part IV: IJ User Interface Part V: Menu Commands 

25 Customizing the ImageJ Interface

Most settings determining the look and feel of ImageJ are listed in EditOptions, namely EditOptionsAppearance… and EditOptionsMisc…↓ (see also Settings and Preferences↑). However, other aspects of the ImageJ interface can also be personalized.

25.1 Floating Behavior of Main Window

It is possible to place the Main ImageJ window↑ above all other windows at all time using a simple JavaScript instruction:
IJ.getInstance().setAlwaysOnTop(true);
To test it, copy this one line script to the clipboard (or download Always_on_Top.js from the online scripts repertoire), switch to ImageJ, type Shift V (FileNewSystem Clipboard [V]↓), then type Ctrl J (MacrosEvaluate Java Script [j]↑). To create an “Always on Top” command, save this script in the plugins folder as Always_on_Top.js and run HelpRefresh Menus↓ to start using the new command. Macro Customizing the Float Behavior of IJ’s Main Window↓ exemplifies how to set this option at launch.

25.2 Pointer

At startup, ImageJ will search for a GIF image named crosshair-cursor.gif in the ImageJ/images/ directory. If present, it will be used to replace the default crosshair cursor. The pointer can also be changed to an arrow by toggling Use pointer cursor on EditOptionsMisc…↓
Table 2 Examples of modified crosshair pointers, more visible on grayscale images. The default crosshair cursor can be replaced by any image saved as crosshair-cursor.gif in ImageJ/images/.
figure images/pointers/crosshair-cursor-1.png figure images/pointers/crosshair-cursor-2.png figure images/pointers/crosshair-cursor-3.png figure images/pointers/crosshair-cursor-4.png figure images/pointers/crosshair-cursor-5.png figure images/pointers/crosshair-cursor-6.png figure images/pointers/crosshair-cursor-7.png figure images/pointers/crosshair-cursor-8.png
Customizing the Float Behavior of IJ’s Main Window
 // These macros can be added to the ImageJ/macros/StartupMacros.txt file in order to set
// the floating behavior of the ImageJ main window
​
 // option 1) Run ImageJ/plugins/Always_on_Top.js command at launch, by adding it to the "AutoRun" macro
 macro "AutoRun" {
   run("Always on Top");
 }
​
 // option 2) Execute the script at launch, by adding it to "AutoRun"
 macro "AutoRun" {
   eval("script", "IJ.getInstance().setAlwaysOnTop(true)");
 }
​
 // option 3) Toggle the setAlwaysOnTop option using a shortcut, e.g., F1
 var afloat;
 macro "Toggle AlwaysOnTop [F1]" {
   booleans = newArray("true", "false");
   eval("script","IJ.getInstance().setAlwaysOnTop("+ booleans[afloat] +")");
   afloat = !afloat;
 }
 Sec. 24: Log Window Up Part IV: IJ User Interface Part V: Menu Commands