Hide
IJ2 is out
13 Settings and Preferences
ImageJ preferences are automatically saved in a preferences file, the IJ_prefs.txt text file. This file is stored in ~/Library/Preferences/ on Mac OS X and in ~/.imagej/ on Linux and Windows (with ~ referring to the user's home directory). Several macros and plugins also write parameters to this file. If the IJ_prefs.txt is erased using , ImageJ will create a new one the next time it is opened resetting all parameters to their default values.
Sometimes, it may be useful to override (or restore) certain settings that may have been changed during a working session. For example, the Limit to threshold option () will affect most measurements performed on thresholded images. Thus, it may be wise to check the status of this parameter before each analysis, specially when working on multiple computers.
Ensuring Specific Settings at Launch
macro "AutoRun" {
setOption("DebugMode", true);
setOption("Bicubic", true);
setOption("Display Label", true);
setOption("Limit to Threshold", false);
setOption("BlackBackground", true);
run("Colors...", "foreground=white background=black"); //this line could be substituted by: setBackgroundColor(0,0,0); setForegroundColor(255,255,255);
run("Profile Plot Options...", "width=350 height=200 draw");
run("Brightness/Contrast...");
}
The
setOption() macro function can be used to set this and several other ImageJ options. Calling this function from the “AutoRun” macro in the
StartupMacros.txt file ensures preferences are set each time ImageJ starts. The macro
Ensuring Specific Settings at Launch↑ exemplifies this approach ensuring that the following settings are enforced at startup:
- TIFF tag values are displayed by ImageJ (Debug Mode in )
- Bicubic interpolation is preferred over bilinear (e.g., )
- The name of the measured image name is recorded in the first column of the Results Table↓ (Display Label in )
- Measurements are not restricted to thresholded pixels (Limit to Threshold in )
- Binary images are processed assuming white objects on a black background (Black background in , see 23: Interpreting Binary Images↓)
- Background color is black and foreground color is white ()
- ImageJ plots contain grid lines and are always 350 × 200 pixels in size ()
- Open the B&C widget at its last saved screen position ()