IJ2 is out
 Sec. 12: 3D Volumes Up Part II: Working with IJ Part III: Extending IJ 

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 EditOptionsReset…, 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 (AnalyzeSet Measurements…) 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");
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:
  1. TIFF tag values are displayed by ImageJ (Debug Mode in EditOptionsMisc…↓)
  2. Bicubic interpolation is preferred over bilinear (e.g., EditSelectionStraighten…↓)
  3. The name of the measured image name is recorded in the first column of the Results Table↓ (Display Label in AnalyzeSet Measurements…)
  4. Measurements are not restricted to thresholded pixels (Limit to Threshold in AnalyzeSet Measurements…)
  5. Binary images are processed assuming white objects on a black background (Black background in ProcessBinaryOptions…, see 23: Interpreting Binary Images↓)
  6. Background color is black and foreground color is white (EditOptionsColors…↓)
  7. ImageJ plots contain grid lines and are always 350 × 200 pixels in size (EditOptionsProfile Plot Options…)
  8. Open the B&C widget at its last saved screen position (ImageAdjustBrightness/Contrast… [C]↓)
 Sec. 12: 3D Volumes Up Part II: Working with IJ Part III: Extending IJ