Package ij
Class Prefs
java.lang.Object
ij.Prefs
public class Prefs extends Object
This class contains the ImageJ preferences, which are
loaded from the "IJ_Props.txt" and "IJ_Prefs.txt" files.
- See Also:
ImageJ
-
Field Summary
Fields Modifier and Type Field Description static boolean
alwaysOnTop
"ImageJ" window is always on top.static boolean
antialiasedText
No longer usedstatic boolean
antialiasedTools
Draw tool icons using antialiasing (always true).static boolean
autoContrast
Adjust contrast when scrolling stacksstatic boolean
autoRunExamples
Automatically run examples in Help/Examples menu.static boolean
avoidResliceInterpolation
Avoid interpolation when re-slicingstatic String
BCOLOR
static boolean
blackBackground
Backgound is black in binary imagesstatic boolean
blackCanvas
Use black image border.static boolean
closingAll
"Close All" command runningstatic boolean
convertToMicrons
Convert tiff units to microns if pixel width is less than 0.0001 cm.static boolean
copyColumnHeaders
Include column headers when copying tables to clipboard.static boolean
dialogCancelButtonOnRight
Dialog "Cancel" button is on right on Linuxstatic String
DIR_IMAGE
static boolean
disableUndo
Disable Edit/Undo command.static String
DIV_BY_ZERO_VALUE
static boolean
doNotSaveWindowLocations
Enable this option to workaround a bug with some Linux window managers that causes windows to wander down the screen.static boolean
dontSaveHeaders
Don't save Results table column headersstatic boolean
dontSaveRowNumbers
Don't save Results table row numbersstatic boolean
doubleBuffer
No longer usedstatic boolean
enhancedLineTool
Allow lines to be created with one click at start and another at the endstatic String
FCOLOR
static boolean
flipXZ
Rotate XZ orthogonal views 180 degreesstatic String
FPS
static String
GUI_SCALE
static boolean
ignoreRescaleSlope
Ignore Rescale Slope when opening DICOMsstatic boolean
intelByteOrder
Export TIFF and Raw using little-endian byte order.static boolean
interpolateScaledImages
Display images scaled <100% using bilinear interpolationstatic boolean
jFileChooserSettingChanged
Use JFileChooser setting changed/static String
JPEG
static boolean
keepArrowSelections
Keep arrow selection after adding to overlaystatic boolean
keepUndoBuffers
Preserve undo (snapshot) buffers when switching imagesstatic String
KEY_PREFIX
static String
MENU_SIZE
static boolean
moveToMisc
Move isolated plugins to Miscellaneous submenu.static boolean
multiPointMode
Use MultiPoint tool.static boolean
noBorder
Do not draw black border around image.static boolean
noClickToGC
Don't run garbage collector when user clicks in status barstatic String
NOISE_SD
static boolean
nonBlockingFilterDialogs
Use NonBlockingGenericDialogs in filtersstatic boolean
noPointLabels
Do not label multiple points created using point tool.static boolean
noRowNumbers
Do not include row numbers when copying tables to clipboard.static boolean
open100Percent
Open images at 100% magnificationstatic boolean
openDicomsAsFloat
Open DICOMs as 32-bit float imagesstatic String
OPTIONS
static String
OPTIONS2
static boolean
padEdges
Extend the borders to foreground for binary erosions and closings.static boolean
paintDoubleBuffered
Aways paint images using double bufferingstatic boolean
pointAddToManager
Add points to ROI Manager.static boolean
pointAddToOverlay
Add points to overlay.static boolean
pointAutoMeasure
Point tool auto-measure mode.static boolean
pointAutoNextSlice
Point tool auto-next slice mode (not saved in IJ_Prefs).static String
PREFS_NAME
static String
PROPS_NAME
static boolean
reflexAngle
Angle tool measures reflex anglestatic boolean
requireControlKey
Require control or command key for keybaord shortcuts.static boolean
reverseNextPreviousOrder
Reverse channel-slice-frame priority used by Next Slice and Previous Slice commands.static String
ROICOLOR
static boolean
rotateYZ
Rotate YZ orthogonal views 90 degreesstatic boolean
runSocketListener
Run the SocketListener.static String
separator
file.separator system propertystatic boolean
setIJMenuBar
Set MenuBar on Macs running Java 8.static String
SHOW_ALL_COLOR
static boolean
showAllPoints
Ignore stack positions when displaying points.static boolean
showAllSliceOnly
Only show ROIs associated with current slice in Roi Manager "Show All" mode.static boolean
skipRawDialog
Do not display dialog when opening .raw filesstatic boolean
smoothWand
Wand tool "Smooth if thresholded" optionstatic boolean
splineFitLines
Automatically spline fit line selectionsstatic boolean
subPixelResolution
Use sub-pixel resolution with line selectionsstatic boolean
supportMacroUndo
Support TRANSFORM Undo in macrosstatic String
THREADS
static boolean
useFileChooser
Use the file chooser to import and export image sequences on Windows and Linuxstatic boolean
useInvertingLut
Open 8-bit images with inverting LUT so 0 is white and 255 is black.static boolean
useJFileChooser
Use JFileChooser instead of FileDialog to open and save files.static boolean
useNamesAsLabels
Use ROI names as "show all" labels in the ROI Managerstatic boolean
usePointerCursor
Use pointer cursor instead of crossstatic boolean
useSystemProxies
Set the "java.net.useSystemProxies" propertystatic boolean
verticalProfile
Plot rectangular selectons verticallystatic String
vistaHint
static boolean
weightedColor
Color to grayscale conversion is weighted (0.299, 0.587, 0.114) if the variable is true. -
Constructor Summary
Constructors Constructor Description Prefs()
-
Method Summary
Modifier and Type Method Description static String
defaultResultsExtension()
static boolean
get(String key, boolean defaultValue)
Uses the keywordkey
to retrieve a boolean from the preferences file.static double
get(String key, double defaultValue)
Uses the keywordkey
to retrieve a number from the preferences file.static String
get(String key, String defaultValue)
Uses the keywordkey
to retrieve a string from the preferences file.static boolean
getBoolean(String key, boolean defaultValue)
Finds a boolean in IJ_Props or IJ_Prefs.txt.static Color
getColor(String key, Color defaultColor)
Finds a color in IJ_Props or IJ_Prefs.txt.static Properties
getControlPanelProperties()
static String
getCustomPrefsPath()
Returns the custom preferences (IJ_Prefs.txt) file path.static String
getCustomPropsPath()
Returns the custom properties (IJ_Props.txt) file path.static String
getDefaultDirectory()
Returns the default directory, if any, or null.static double
getDouble(String key, double defaultValue)
Looks up a real number in IJ_Props or IJ_Prefs.txt.static String
getFileSeparator()
Returns the file.separator system property.static double
getGuiScale()
Returns the GenericDialog and Command Finder text scale.static String
getHomeDir()
Obsolete, replaced by getImageJDir(), which, unlike this method, returns a path that ends with File.separator.static String
getImageJDir()
Returns the path, ending in File.separator, to the ImageJ directory.static String
getImagesURL()
Returns the URL of the directory that contains the ImageJ sample images.static int
getInt(String key, int defaultValue)
Finds an int in IJ_Props or IJ_Prefs.txt.static Point
getLocation(String key)
Uses the keywordkey
to retrieve a location from the preferences file.static String
getPrefsDir()
Returns the path to the directory where the preferences file (IJPrefs.txt) is saved.static String
getString(String key)
Finds a string in IJ_Props or IJ_Prefs.txt.static String
getString(String key, String defaultString)
Finds an string in IJ_Props or IJ_Prefs.txt.static int
getThreads()
Returns the number of threads used by PlugInFilters to process images and stacks.static int
getTransparentIndex()
Returns the transparent index (0-255), or -1 if transparency is disabled.static String
load(Object ij, Applet applet)
Finds and loads the configuration file ("IJ_Props.txt") and the preferences file ("IJ_Prefs.txt").static void
resetPreferences()
Delete the preferences file when ImageJ quits.static void
saveLocation(String key, Point loc)
Saves the Pointloc
in the preferences file as a string using the keywordkey
.static void
savePreferences()
Saves user preferences in the IJ_Prefs.txt properties file.static void
savePrefs(Properties prefs, String path)
static void
set(String key, boolean value)
Saves the boolean variablevalue
in the preferences file using the keywordkey
.static void
set(String key, double value)
Savesvalue
in the preferences file using the keywordkey
.static void
set(String key, int value)
Savesvalue
in the preferences file using the keywordkey
.static void
set(String key, String text)
Saves the value of the stringtext
in the preferences file using the keywordkey
.static void
setGuiScale(double scale)
Sets the GenericDialog and Command Finder text scale (0.5 to 3.0).static void
setImagesURL(String url)
Sets the URL of the directory that contains the ImageJ sample images.static void
setThreads(int n)
Sets the number of threads (1-32) used by PlugInFilters to process stacks.static void
setTransparentIndex(int index)
Sets the transparent index (0-255), or set to -1 to disable transparency.
-
Field Details
-
PROPS_NAME
- See Also:
- Constant Field Values
-
PREFS_NAME
- See Also:
- Constant Field Values
-
DIR_IMAGE
- See Also:
- Constant Field Values
-
FCOLOR
- See Also:
- Constant Field Values
-
BCOLOR
- See Also:
- Constant Field Values
-
ROICOLOR
- See Also:
- Constant Field Values
-
SHOW_ALL_COLOR
- See Also:
- Constant Field Values
-
JPEG
- See Also:
- Constant Field Values
-
FPS
- See Also:
- Constant Field Values
-
DIV_BY_ZERO_VALUE
- See Also:
- Constant Field Values
-
NOISE_SD
- See Also:
- Constant Field Values
-
MENU_SIZE
- See Also:
- Constant Field Values
-
GUI_SCALE
- See Also:
- Constant Field Values
-
THREADS
- See Also:
- Constant Field Values
-
KEY_PREFIX
- See Also:
- Constant Field Values
-
OPTIONS
- See Also:
- Constant Field Values
-
vistaHint
- See Also:
- Constant Field Values
-
OPTIONS2
- See Also:
- Constant Field Values
-
separator
file.separator system property -
usePointerCursor
public static boolean usePointerCursorUse pointer cursor instead of cross -
antialiasedText
public static boolean antialiasedTextNo longer used -
interpolateScaledImages
public static boolean interpolateScaledImagesDisplay images scaled <100% using bilinear interpolation -
open100Percent
public static boolean open100PercentOpen images at 100% magnification -
blackBackground
public static boolean blackBackgroundBackgound is black in binary images -
useJFileChooser
public static boolean useJFileChooserUse JFileChooser instead of FileDialog to open and save files. -
weightedColor
public static boolean weightedColorColor to grayscale conversion is weighted (0.299, 0.587, 0.114) if the variable is true. -
blackCanvas
public static boolean blackCanvasUse black image border. -
pointAutoMeasure
public static boolean pointAutoMeasurePoint tool auto-measure mode. -
pointAutoNextSlice
public static boolean pointAutoNextSlicePoint tool auto-next slice mode (not saved in IJ_Prefs). -
requireControlKey
public static boolean requireControlKeyRequire control or command key for keybaord shortcuts. -
useInvertingLut
public static boolean useInvertingLutOpen 8-bit images with inverting LUT so 0 is white and 255 is black. -
antialiasedTools
public static boolean antialiasedToolsDraw tool icons using antialiasing (always true). -
intelByteOrder
public static boolean intelByteOrderExport TIFF and Raw using little-endian byte order. -
doubleBuffer
public static boolean doubleBufferNo longer used -
noPointLabels
public static boolean noPointLabelsDo not label multiple points created using point tool. -
disableUndo
public static boolean disableUndoDisable Edit/Undo command. -
noBorder
public static boolean noBorderDo not draw black border around image. -
showAllSliceOnly
public static boolean showAllSliceOnlyOnly show ROIs associated with current slice in Roi Manager "Show All" mode. -
copyColumnHeaders
public static boolean copyColumnHeadersInclude column headers when copying tables to clipboard. -
noRowNumbers
public static boolean noRowNumbersDo not include row numbers when copying tables to clipboard. -
moveToMisc
public static boolean moveToMiscMove isolated plugins to Miscellaneous submenu. -
pointAddToManager
public static boolean pointAddToManagerAdd points to ROI Manager. -
pointAddToOverlay
public static boolean pointAddToOverlayAdd points to overlay. -
padEdges
public static boolean padEdgesExtend the borders to foreground for binary erosions and closings. -
runSocketListener
public static boolean runSocketListenerRun the SocketListener. -
multiPointMode
public static boolean multiPointModeUse MultiPoint tool. -
openDicomsAsFloat
public static boolean openDicomsAsFloatOpen DICOMs as 32-bit float images -
ignoreRescaleSlope
public static boolean ignoreRescaleSlopeIgnore Rescale Slope when opening DICOMs -
verticalProfile
public static boolean verticalProfilePlot rectangular selectons vertically -
rotateYZ
public static boolean rotateYZRotate YZ orthogonal views 90 degrees -
flipXZ
public static boolean flipXZRotate XZ orthogonal views 180 degrees -
dontSaveHeaders
public static boolean dontSaveHeadersDon't save Results table column headers -
dontSaveRowNumbers
public static boolean dontSaveRowNumbersDon't save Results table row numbers -
noClickToGC
public static boolean noClickToGCDon't run garbage collector when user clicks in status bar -
reflexAngle
public static boolean reflexAngleAngle tool measures reflex angle -
avoidResliceInterpolation
public static boolean avoidResliceInterpolationAvoid interpolation when re-slicing -
keepUndoBuffers
public static boolean keepUndoBuffersPreserve undo (snapshot) buffers when switching images -
useNamesAsLabels
public static boolean useNamesAsLabelsUse ROI names as "show all" labels in the ROI Manager -
useSystemProxies
public static boolean useSystemProxiesSet the "java.net.useSystemProxies" property -
useFileChooser
public static boolean useFileChooserUse the file chooser to import and export image sequences on Windows and Linux -
subPixelResolution
public static boolean subPixelResolutionUse sub-pixel resolution with line selections -
autoContrast
public static boolean autoContrastAdjust contrast when scrolling stacks -
enhancedLineTool
public static boolean enhancedLineToolAllow lines to be created with one click at start and another at the end -
keepArrowSelections
public static boolean keepArrowSelectionsKeep arrow selection after adding to overlay -
paintDoubleBuffered
public static boolean paintDoubleBufferedAways paint images using double buffering -
skipRawDialog
public static boolean skipRawDialogDo not display dialog when opening .raw files -
reverseNextPreviousOrder
public static boolean reverseNextPreviousOrderReverse channel-slice-frame priority used by Next Slice and Previous Slice commands. -
autoRunExamples
public static boolean autoRunExamplesAutomatically run examples in Help/Examples menu. -
showAllPoints
public static boolean showAllPointsIgnore stack positions when displaying points. -
setIJMenuBar
public static boolean setIJMenuBarSet MenuBar on Macs running Java 8. -
alwaysOnTop
public static boolean alwaysOnTop"ImageJ" window is always on top. -
splineFitLines
public static boolean splineFitLinesAutomatically spline fit line selections -
doNotSaveWindowLocations
public static boolean doNotSaveWindowLocationsEnable this option to workaround a bug with some Linux window managers that causes windows to wander down the screen. -
jFileChooserSettingChanged
public static boolean jFileChooserSettingChangedUse JFileChooser setting changed/ -
convertToMicrons
public static boolean convertToMicronsConvert tiff units to microns if pixel width is less than 0.0001 cm. -
smoothWand
public static boolean smoothWandWand tool "Smooth if thresholded" option -
closingAll
public static boolean closingAll"Close All" command running -
dialogCancelButtonOnRight
public static boolean dialogCancelButtonOnRightDialog "Cancel" button is on right on Linux -
supportMacroUndo
public static boolean supportMacroUndoSupport TRANSFORM Undo in macros -
nonBlockingFilterDialogs
public static boolean nonBlockingFilterDialogsUse NonBlockingGenericDialogs in filters
-
-
Constructor Details
-
Prefs
public Prefs()
-
-
Method Details
-
load
Finds and loads the configuration file ("IJ_Props.txt") and the preferences file ("IJ_Prefs.txt").- Returns:
- an error message if "IJ_Props.txt" not found.
-
getImagesURL
Returns the URL of the directory that contains the ImageJ sample images. -
setImagesURL
Sets the URL of the directory that contains the ImageJ sample images. -
getHomeDir
Obsolete, replaced by getImageJDir(), which, unlike this method, returns a path that ends with File.separator. -
getImageJDir
Returns the path, ending in File.separator, to the ImageJ directory. -
getPrefsDir
Returns the path to the directory where the preferences file (IJPrefs.txt) is saved. -
getDefaultDirectory
Returns the default directory, if any, or null. -
getString
Finds a string in IJ_Props or IJ_Prefs.txt. -
getString
Finds an string in IJ_Props or IJ_Prefs.txt. -
getBoolean
Finds a boolean in IJ_Props or IJ_Prefs.txt. -
getInt
Finds an int in IJ_Props or IJ_Prefs.txt. -
getDouble
Looks up a real number in IJ_Props or IJ_Prefs.txt. -
getColor
Finds a color in IJ_Props or IJ_Prefs.txt. -
getFileSeparator
Returns the file.separator system property. -
savePreferences
public static void savePreferences()Saves user preferences in the IJ_Prefs.txt properties file. -
resetPreferences
public static void resetPreferences()Delete the preferences file when ImageJ quits. -
set
Saves the value of the stringtext
in the preferences file using the keywordkey
. This string can be retrieved using the appropriateget()
method. -
set
Savesvalue
in the preferences file using the keywordkey
. This value can be retrieved using the appropriategetPref()
method. -
set
Savesvalue
in the preferences file using the keywordkey
. This value can be retrieved using the appropriategetPref()
method. -
set
Saves the boolean variablevalue
in the preferences file using the keywordkey
. This value can be retrieved using the appropriategetPref()
method. -
get
Uses the keywordkey
to retrieve a string from the preferences file. ReturnsdefaultValue
if the key is not found. -
get
Uses the keywordkey
to retrieve a number from the preferences file. ReturnsdefaultValue
if the key is not found. -
get
Uses the keywordkey
to retrieve a boolean from the preferences file. ReturnsdefaultValue
if the key is not found. -
saveLocation
Saves the Pointloc
in the preferences file as a string using the keywordkey
. -
getLocation
Uses the keywordkey
to retrieve a location from the preferences file. Returns null if the key is not found or the location is not valid (e.g., offscreen). -
savePrefs
- Throws:
IOException
-
getThreads
public static int getThreads()Returns the number of threads used by PlugInFilters to process images and stacks. -
setThreads
public static void setThreads(int n)Sets the number of threads (1-32) used by PlugInFilters to process stacks. -
setTransparentIndex
public static void setTransparentIndex(int index)Sets the transparent index (0-255), or set to -1 to disable transparency. -
getTransparentIndex
public static int getTransparentIndex()Returns the transparent index (0-255), or -1 if transparency is disabled. -
getControlPanelProperties
-
defaultResultsExtension
-
setGuiScale
public static void setGuiScale(double scale)Sets the GenericDialog and Command Finder text scale (0.5 to 3.0). -
getGuiScale
public static double getGuiScale()Returns the GenericDialog and Command Finder text scale. -
getCustomPropsPath
Returns the custom properties (IJ_Props.txt) file path. -
getCustomPrefsPath
Returns the custom preferences (IJ_Prefs.txt) file path.
-