- java.lang.Object
-
- ij.Prefs
-
public class Prefs extends java.lang.ObjectThis 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 booleanalwaysOnTop"ImageJ" window is always on top.static booleanantialiasedTextNo longer usedstatic booleanantialiasedToolsDraw tool icons using antialiasing (always true).static booleanautoContrastAdjust contrast when scrolling stacksstatic booleanautoLivePlotsTurn live display on plots automaticallystatic booleanautoRunExamplesAutomatically run examples in Help/Examples menu.static booleanavoidResliceInterpolationAvoid interpolation when re-slicingstatic java.lang.StringBCOLORstatic booleanblackBackgroundBackgound is black in binary imagesstatic booleanblackCanvasUse black image border.static booleanclosingAll"Close All" command runningstatic booleanconvertToMicronsConvert tiff units to microns if pixel width is less than 0.0001 cm.static booleancopyColumnHeadersInclude column headers when copying tables to clipboard.static booleandialogCancelButtonOnRightDialog "Cancel" button is on right on Linuxstatic java.lang.StringDIR_IMAGEstatic booleandisableUndoDisable Edit/Undo command.static java.lang.StringDIV_BY_ZERO_VALUEstatic booleandoNotSaveWindowLocationsEnable this option to workaround a bug with some Linux window managers that causes windows to wander down the screen.static booleandontSaveHeadersDon't save Results table column headersstatic booleandontSaveRowNumbersDon't save Results table row numbersstatic booleandoubleBufferNo longer usedstatic booleanenhancedLineToolAllow lines to be created with one click at start and another at the endstatic java.lang.StringFCOLORstatic booleanfixedDicomScalingAssume DICOM volumes use identical RescaleSlope and RescaleIntercept across all slicesstatic booleanflipXZRotate XZ orthogonal views 180 degreesstatic java.lang.StringFPSstatic java.lang.StringGUI_SCALEstatic booleanignoreRescaleSlopeIgnore Rescale Slope when opening DICOMsstatic booleanintelByteOrderExport TIFF and Raw using little-endian byte order.static booleaninterpolateScaledImagesDisplay images scaled <100% using bilinear interpolationstatic booleanjFileChooserSettingChangedUse JFileChooser setting changed/static java.lang.StringJPEGstatic booleankeepArrowSelectionsKeep arrow selection after adding to overlaystatic booleankeepUndoBuffersPreserve undo (snapshot) buffers when switching imagesstatic java.lang.StringKEY_PREFIXstatic java.lang.StringMENU_SIZEstatic booleanmoveToMiscMove isolated plugins to Miscellaneous submenu.static booleanmultiPointModeUse MultiPoint tool.static booleannoBorderDo not draw black border around image.static booleannoClickToGCDon't run garbage collector when user clicks in status barstatic java.lang.StringNOISE_SDstatic booleannonBlockingFilterDialogsUse NonBlockingGenericDialogs in filtersstatic booleannoPointLabelsDo not label multiple points created using point tool.static booleannoRowNumbersDo not include row numbers when copying tables to clipboard.static booleanopen100PercentOpen images at 100% magnificationstatic booleanopenDicomsAsFloatOpen DICOMs as 32-bit float imagesstatic java.lang.StringOPTIONSstatic java.lang.StringOPTIONS2static booleanpadEdgesExtend the borders to foreground for binary erosions and closings.static booleanpaintDoubleBufferedAways paint images using double bufferingstatic booleanpointAddToManagerAdd points to ROI Manager.static booleanpointAddToOverlayAdd points to overlay.static booleanpointAutoMeasurePoint tool auto-measure mode.static booleanpointAutoNextSlicePoint tool auto-next slice mode (not saved in IJ_Prefs).static java.lang.StringPREFS_NAMEstatic java.lang.StringPROPS_NAMEstatic booleanreflexAngleAngle tool measures reflex anglestatic booleanrequireControlKeyRequire control or command key for keybaord shortcuts.static booleanreverseNextPreviousOrderReverse channel-slice-frame priority used by Next Slice and Previous Slice commands.static java.lang.StringROICOLORstatic booleanrotateYZRotate YZ orthogonal views 90 degreesstatic booleanrunSocketListenerRun the SocketListener.static java.lang.Stringseparatorfile.separator system propertystatic booleansetIJMenuBarSet MenuBar on Macs running Java 8.static java.lang.StringSHOW_ALL_COLORstatic booleanshowAllPointsIgnore stack positions when displaying points.static booleanshowAllSliceOnlyOnly show ROIs associated with current slice in Roi Manager "Show All" mode.static booleanskipRawDialogDo not display dialog when opening .raw filesstatic booleansmoothWandWand tool "Smooth if thresholded" optionstatic booleansplineFitLinesAutomatically spline fit line selectionsstatic booleansubPixelResolutionUse sub-pixel resolution with line selectionsstatic booleansupportMacroUndoSupport TRANSFORM Undo in macrosstatic java.lang.StringTHREADSstatic booleanuseFileChooserUse the file chooser to import and export image sequences on Windows and Linuxstatic booleanuseInvertingLutOpen 8-bit images with inverting LUT so 0 is white and 255 is black.static booleanuseJFileChooserUse JFileChooser instead of FileDialog to open and save files.static booleanuseNamesAsLabelsUse ROI names as "show all" labels in the ROI Managerstatic booleanusePointerCursorUse pointer cursor instead of crossstatic booleanuseSystemProxiesSet the "java.net.useSystemProxies" propertystatic booleanverticalProfilePlot rectangular selectons verticallystatic java.lang.StringvistaHintstatic booleanweightedColorColor to grayscale conversion is weighted (0.299, 0.587, 0.114) if the variable is true.
-
Constructor Summary
Constructors Constructor Description Prefs()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancommandLineMacro()static java.lang.StringdefaultResultsExtension()static booleanget(java.lang.String key, boolean defaultValue)Uses the keywordkeyto retrieve a boolean from the preferences file.static doubleget(java.lang.String key, double defaultValue)Uses the keywordkeyto retrieve a number from the preferences file.static java.lang.Stringget(java.lang.String key, java.lang.String defaultValue)Uses the keywordkeyto retrieve a string from the preferences file.static booleangetBoolean(java.lang.String key, boolean defaultValue)Retrieves a boolean from IJ_Props or IJ_Prefs.txt.static java.awt.ColorgetColor(java.lang.String key, java.awt.Color defaultColor)Finds a color in IJ_Props or IJ_Prefs.txt.static java.util.PropertiesgetControlPanelProperties()static java.lang.StringgetCustomPrefsPath()Returns the custom preferences (IJ_Prefs.txt) file path.static java.lang.StringgetCustomPropsPath()Returns the custom properties (IJ_Props.txt) file path.static java.lang.StringgetDefaultDirectory()Returns the default directory, if any, or null.static doublegetDouble(java.lang.String key, double defaultValue)Retrieves a number from IJ_Props or IJ_Prefs.txt.static java.lang.StringgetFileSeparator()Returns the file.separator system property.static doublegetGuiScale()Returns the GenericDialog and Command Finder text scale.static java.lang.StringgetHomeDir()Obsolete, replaced by getImageJDir(), which, unlike this method, returns a path that ends with File.separator.static java.lang.StringgetImageJDir()Returns the path, ending in File.separator, to the ImageJ directory.static java.lang.StringgetImagesURL()Returns the URL of the directory that contains the ImageJ sample images.static intgetInt(java.lang.String key, int defaultValue)Retrieves a number from IJ_Props or IJ_Prefs.txt.static java.awt.PointgetLocation(java.lang.String key)Uses the keywordkeyto retrieve a location from the preferences file.static java.lang.StringgetPluginsDirProperty()static java.lang.StringgetPrefsDir()Returns the path to the directory where the preferences file (IJPrefs.txt) is saved.static java.lang.StringgetString(java.lang.String key)Retrieves a string from string in IJ_Props or IJ_Prefs.txt.static java.lang.StringgetString(java.lang.String key, java.lang.String defaultString)Retrieves a string from IJ_Props or IJ_Prefs.txt.static intgetThreads()Returns the number of threads used by PlugInFilters to process images and stacks.static intgetTransparentIndex()Returns the transparent index (0-255), or -1 if transparency is disabled.static java.lang.Stringload(java.lang.Object ij, java.applet.Applet applet)Finds and loads the configuration file ("IJ_Props.txt") and the preferences file ("IJ_Prefs.txt").static voidresetPreferences()Delete the preferences file when ImageJ quits.static voidsaveLocation(java.lang.String key, java.awt.Point loc)Saves the Pointlocin the preferences file as a string using the keywordkey.static voidsavePreferences()Saves user preferences in the IJ_Prefs.txt properties file.static voidsavePrefs(java.util.Properties prefs, java.lang.String path)static voidset(java.lang.String key, boolean value)Saves the value of the booleanvaluein the preferences file using the keywordkey.static voidset(java.lang.String key, double value)Saves the value of the doublevaluein the preferences file using the keywordkey.static voidset(java.lang.String key, int value)Saves the value of the integervaluein the preferences file using the keywordkey.static voidset(java.lang.String key, java.lang.String text)Saves the value of the stringtextin the preferences file using the keywordkey.static voidsetGuiScale(double scale)Sets the GenericDialog and Command Finder text scale (0.5 to 3.0).static voidsetImagesURL(java.lang.String url)Sets the URL of the directory that contains the ImageJ sample images.static voidsetThreads(int n)Sets the number of threads (1-32) used by PlugInFilters to process stacks.static voidsetTransparentIndex(int index)Sets the transparent index (0-255), or set to -1 to disable transparency.
-
-
-
Field Detail
-
PROPS_NAME
public static final java.lang.String PROPS_NAME
- See Also:
- Constant Field Values
-
PREFS_NAME
public static final java.lang.String PREFS_NAME
- See Also:
- Constant Field Values
-
DIR_IMAGE
public static final java.lang.String DIR_IMAGE
- See Also:
- Constant Field Values
-
FCOLOR
public static final java.lang.String FCOLOR
- See Also:
- Constant Field Values
-
BCOLOR
public static final java.lang.String BCOLOR
- See Also:
- Constant Field Values
-
ROICOLOR
public static final java.lang.String ROICOLOR
- See Also:
- Constant Field Values
-
SHOW_ALL_COLOR
public static final java.lang.String SHOW_ALL_COLOR
- See Also:
- Constant Field Values
-
JPEG
public static final java.lang.String JPEG
- See Also:
- Constant Field Values
-
FPS
public static final java.lang.String FPS
- See Also:
- Constant Field Values
-
DIV_BY_ZERO_VALUE
public static final java.lang.String DIV_BY_ZERO_VALUE
- See Also:
- Constant Field Values
-
NOISE_SD
public static final java.lang.String NOISE_SD
- See Also:
- Constant Field Values
-
MENU_SIZE
public static final java.lang.String MENU_SIZE
- See Also:
- Constant Field Values
-
GUI_SCALE
public static final java.lang.String GUI_SCALE
- See Also:
- Constant Field Values
-
THREADS
public static final java.lang.String THREADS
- See Also:
- Constant Field Values
-
KEY_PREFIX
public static final java.lang.String KEY_PREFIX
- See Also:
- Constant Field Values
-
OPTIONS
public static final java.lang.String OPTIONS
- See Also:
- Constant Field Values
-
vistaHint
public static final java.lang.String vistaHint
- See Also:
- Constant Field Values
-
OPTIONS2
public static final java.lang.String OPTIONS2
- See Also:
- Constant Field Values
-
separator
public static java.lang.String separator
file.separator system property
-
usePointerCursor
public static boolean usePointerCursor
Use pointer cursor instead of cross
-
antialiasedText
public static boolean antialiasedText
No longer used
-
interpolateScaledImages
public static boolean interpolateScaledImages
Display images scaled <100% using bilinear interpolation
-
open100Percent
public static boolean open100Percent
Open images at 100% magnification
-
blackBackground
public static boolean blackBackground
Backgound is black in binary images
-
useJFileChooser
public static boolean useJFileChooser
Use JFileChooser instead of FileDialog to open and save files.
-
weightedColor
public static boolean weightedColor
Color to grayscale conversion is weighted (0.299, 0.587, 0.114) if the variable is true.
-
blackCanvas
public static boolean blackCanvas
Use black image border.
-
pointAutoMeasure
public static boolean pointAutoMeasure
Point tool auto-measure mode.
-
pointAutoNextSlice
public static boolean pointAutoNextSlice
Point tool auto-next slice mode (not saved in IJ_Prefs).
-
requireControlKey
public static boolean requireControlKey
Require control or command key for keybaord shortcuts.
-
useInvertingLut
public static boolean useInvertingLut
Open 8-bit images with inverting LUT so 0 is white and 255 is black.
-
antialiasedTools
public static boolean antialiasedTools
Draw tool icons using antialiasing (always true).
-
intelByteOrder
public static boolean intelByteOrder
Export TIFF and Raw using little-endian byte order.
-
doubleBuffer
public static boolean doubleBuffer
No longer used
-
noPointLabels
public static boolean noPointLabels
Do not label multiple points created using point tool.
-
disableUndo
public static boolean disableUndo
Disable Edit/Undo command.
-
noBorder
public static boolean noBorder
Do not draw black border around image.
-
showAllSliceOnly
public static boolean showAllSliceOnly
Only show ROIs associated with current slice in Roi Manager "Show All" mode.
-
copyColumnHeaders
public static boolean copyColumnHeaders
Include column headers when copying tables to clipboard.
-
noRowNumbers
public static boolean noRowNumbers
Do not include row numbers when copying tables to clipboard.
-
moveToMisc
public static boolean moveToMisc
Move isolated plugins to Miscellaneous submenu.
-
pointAddToManager
public static boolean pointAddToManager
Add points to ROI Manager.
-
pointAddToOverlay
public static boolean pointAddToOverlay
Add points to overlay.
-
padEdges
public static boolean padEdges
Extend the borders to foreground for binary erosions and closings.
-
runSocketListener
public static boolean runSocketListener
Run the SocketListener.
-
multiPointMode
public static boolean multiPointMode
Use MultiPoint tool.
-
openDicomsAsFloat
public static boolean openDicomsAsFloat
Open DICOMs as 32-bit float images
-
ignoreRescaleSlope
public static boolean ignoreRescaleSlope
Ignore Rescale Slope when opening DICOMs
-
fixedDicomScaling
public static boolean fixedDicomScaling
Assume DICOM volumes use identical RescaleSlope and RescaleIntercept across all slices
-
verticalProfile
public static boolean verticalProfile
Plot rectangular selectons vertically
-
rotateYZ
public static boolean rotateYZ
Rotate YZ orthogonal views 90 degrees
-
flipXZ
public static boolean flipXZ
Rotate XZ orthogonal views 180 degrees
-
dontSaveHeaders
public static boolean dontSaveHeaders
Don't save Results table column headers
-
dontSaveRowNumbers
public static boolean dontSaveRowNumbers
Don't save Results table row numbers
-
noClickToGC
public static boolean noClickToGC
Don't run garbage collector when user clicks in status bar
-
reflexAngle
public static boolean reflexAngle
Angle tool measures reflex angle
-
avoidResliceInterpolation
public static boolean avoidResliceInterpolation
Avoid interpolation when re-slicing
-
keepUndoBuffers
public static boolean keepUndoBuffers
Preserve undo (snapshot) buffers when switching images
-
useNamesAsLabels
public static boolean useNamesAsLabels
Use ROI names as "show all" labels in the ROI Manager
-
useSystemProxies
public static boolean useSystemProxies
Set the "java.net.useSystemProxies" property
-
useFileChooser
public static boolean useFileChooser
Use the file chooser to import and export image sequences on Windows and Linux
-
subPixelResolution
public static boolean subPixelResolution
Use sub-pixel resolution with line selections
-
autoContrast
public static boolean autoContrast
Adjust contrast when scrolling stacks
-
enhancedLineTool
public static boolean enhancedLineTool
Allow lines to be created with one click at start and another at the end
-
keepArrowSelections
public static boolean keepArrowSelections
Keep arrow selection after adding to overlay
-
paintDoubleBuffered
public static boolean paintDoubleBuffered
Aways paint images using double buffering
-
skipRawDialog
public static boolean skipRawDialog
Do not display dialog when opening .raw files
-
reverseNextPreviousOrder
public static boolean reverseNextPreviousOrder
Reverse channel-slice-frame priority used by Next Slice and Previous Slice commands.
-
autoRunExamples
public static boolean autoRunExamples
Automatically run examples in Help/Examples menu.
-
showAllPoints
public static boolean showAllPoints
Ignore stack positions when displaying points.
-
setIJMenuBar
public static boolean setIJMenuBar
Set MenuBar on Macs running Java 8.
-
alwaysOnTop
public static boolean alwaysOnTop
"ImageJ" window is always on top.
-
splineFitLines
public static boolean splineFitLines
Automatically spline fit line selections
-
doNotSaveWindowLocations
public static boolean doNotSaveWindowLocations
Enable this option to workaround a bug with some Linux window managers that causes windows to wander down the screen.
-
jFileChooserSettingChanged
public static boolean jFileChooserSettingChanged
Use JFileChooser setting changed/
-
convertToMicrons
public static boolean convertToMicrons
Convert tiff units to microns if pixel width is less than 0.0001 cm.
-
smoothWand
public static boolean smoothWand
Wand tool "Smooth if thresholded" option
-
closingAll
public static boolean closingAll
"Close All" command running
-
dialogCancelButtonOnRight
public static boolean dialogCancelButtonOnRight
Dialog "Cancel" button is on right on Linux
-
supportMacroUndo
public static boolean supportMacroUndo
Support TRANSFORM Undo in macros
-
nonBlockingFilterDialogs
public static boolean nonBlockingFilterDialogs
Use NonBlockingGenericDialogs in filters
-
autoLivePlots
public static boolean autoLivePlots
Turn live display on plots automatically
-
-
Method Detail
-
set
public static void set(java.lang.String key, java.lang.String text)Saves the value of the stringtextin the preferences file using the keywordkey. The string can be retrieved using the appropriateget()method.- See Also:
get(String,String)
-
set
public static void set(java.lang.String key, int value)Saves the value of the integervaluein the preferences file using the keywordkey. The value can be retrieved using the appropriateget()method.- See Also:
get(String,double)
-
set
public static void set(java.lang.String key, double value)Saves the value of the doublevaluein the preferences file using the keywordkey. The value can be retrieved using the appropriateget()method.- See Also:
get(String,double)
-
set
public static void set(java.lang.String key, boolean value)Saves the value of the booleanvaluein the preferences file using the keywordkey. The value can be retrieved using the appropriateget()method.- See Also:
get(String,boolean)
-
get
public static java.lang.String get(java.lang.String key, java.lang.String defaultValue)Uses the keywordkeyto retrieve a string from the preferences file. ReturnsdefaultValueif the key is not found.
-
get
public static double get(java.lang.String key, double defaultValue)Uses the keywordkeyto retrieve a number from the preferences file. ReturnsdefaultValueif the key is not found.
-
get
public static boolean get(java.lang.String key, boolean defaultValue)Uses the keywordkeyto retrieve a boolean from the preferences file. ReturnsdefaultValueif the key is not found.
-
load
public static java.lang.String load(java.lang.Object ij, java.applet.Applet applet)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
public static java.lang.String getImagesURL()
Returns the URL of the directory that contains the ImageJ sample images.
-
setImagesURL
public static void setImagesURL(java.lang.String url)
Sets the URL of the directory that contains the ImageJ sample images.
-
getHomeDir
public static java.lang.String getHomeDir()
Obsolete, replaced by getImageJDir(), which, unlike this method, returns a path that ends with File.separator.
-
getImageJDir
public static java.lang.String getImageJDir()
Returns the path, ending in File.separator, to the ImageJ directory.
-
getPluginsDirProperty
public static java.lang.String getPluginsDirProperty()
-
getPrefsDir
public static java.lang.String getPrefsDir()
Returns the path to the directory where the preferences file (IJPrefs.txt) is saved.
-
getDefaultDirectory
public static java.lang.String getDefaultDirectory()
Returns the default directory, if any, or null.
-
getFileSeparator
public static java.lang.String 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.
-
saveLocation
public static void saveLocation(java.lang.String key, java.awt.Point loc)Saves the Pointlocin the preferences file as a string using the keywordkey.
-
getLocation
public static java.awt.Point getLocation(java.lang.String key)
Uses the keywordkeyto 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
public static void savePrefs(java.util.Properties prefs, java.lang.String path) throws java.io.IOException- Throws:
java.io.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
public static java.util.Properties getControlPanelProperties()
-
defaultResultsExtension
public static java.lang.String 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
public static java.lang.String getCustomPropsPath()
Returns the custom properties (IJ_Props.txt) file path.
-
getCustomPrefsPath
public static java.lang.String getCustomPrefsPath()
Returns the custom preferences (IJ_Prefs.txt) file path.
-
getString
public static java.lang.String getString(java.lang.String key, java.lang.String defaultString)Retrieves a string from IJ_Props or IJ_Prefs.txt. Does not retrieve strings set using Prefs.set().
-
getString
public static java.lang.String getString(java.lang.String key)
Retrieves a string from string in IJ_Props or IJ_Prefs.txt.
-
getInt
public static int getInt(java.lang.String key, int defaultValue)Retrieves a number from IJ_Props or IJ_Prefs.txt. Does not retrieve numbers set using Prefs.set().
-
getDouble
public static double getDouble(java.lang.String key, double defaultValue)Retrieves a number from IJ_Props or IJ_Prefs.txt. Does not retrieve numbers set using Prefs.set().
-
getBoolean
public static boolean getBoolean(java.lang.String key, boolean defaultValue)Retrieves a boolean from IJ_Props or IJ_Prefs.txt. Does not retrieve boolean set using Prefs.set().
-
getColor
public static java.awt.Color getColor(java.lang.String key, java.awt.Color defaultColor)Finds a color in IJ_Props or IJ_Prefs.txt.
-
commandLineMacro
public static boolean commandLineMacro()
-
-