Package ij

Class 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:
  • Field Details

    • PROPS_NAME

      public static final String PROPS_NAME
      See Also:
    • PREFS_NAME

      public static final String PREFS_NAME
      See Also:
    • DIR_IMAGE

      public static final String DIR_IMAGE
      See Also:
    • FCOLOR

      public static final String FCOLOR
      See Also:
    • BCOLOR

      public static final String BCOLOR
      See Also:
    • ROICOLOR

      public static final String ROICOLOR
      See Also:
    • SHOW_ALL_COLOR

      public static final String SHOW_ALL_COLOR
      See Also:
    • JPEG

      public static final String JPEG
      See Also:
    • FPS

      public static final String FPS
      See Also:
    • DIV_BY_ZERO_VALUE

      public static final String DIV_BY_ZERO_VALUE
      See Also:
    • NOISE_SD

      public static final String NOISE_SD
      See Also:
    • THREADS

      public static final String THREADS
      See Also:
    • KEY_PREFIX

      public static final String KEY_PREFIX
      See Also:
    • OPTIONS

      public static final String OPTIONS
      See Also:
    • vistaHint

      public static final String vistaHint
      See Also:
    • OPTIONS2

      public static final String OPTIONS2
      See Also:
    • separator

      public static 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.
    • intelByteOrder

      public static boolean intelByteOrder
      Export TIFF and Raw using little-endian byte order.
    • doubleBuffer

      public static boolean doubleBuffer
      Double buffer display of selections and overlays.
    • 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
    • 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 (or hold shift key down)
    • 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 using double buffering, except on OS X
    • 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.
  • Constructor Details

    • Prefs

      public Prefs()
  • Method Details

    • load

      public static String load(Object ij, Applet applet)
      Finds and loads the ImageJ configuration file, "IJ_Props.txt".
      Returns:
      an error message if "IJ_Props.txt" not found.
    • getImagesURL

      public static String getImagesURL()
      Returns the URL of the directory that contains the ImageJ sample images.
    • setImagesURL

      public static void setImagesURL(String url)
      Sets the URL of the directory that contains the ImageJ sample images.
    • getHomeDir

      public static String getHomeDir()
      Obsolete, replaced by getImageJDir(), which, unlike this method, returns a path that ends with File.separator.
    • getImageJDir

      public static String getImageJDir()
      Returns the path, ending in File.separator, to the ImageJ directory.
    • getPrefsDir

      public static String getPrefsDir()
      Gets the path to the directory where the preferences file (IJPrefs.txt) is saved.
    • getDefaultDirectory

      public static String getDefaultDirectory()
      Returns the default directory, if any, or null.
    • getString

      public static String getString(String key)
      Finds an string in IJ_Props or IJ_Prefs.txt.
    • getString

      public static String getString(String key, String defaultString)
      Finds an string in IJ_Props or IJ_Prefs.txt.
    • getBoolean

      public static boolean getBoolean(String key, boolean defaultValue)
      Finds a boolean in IJ_Props or IJ_Prefs.txt.
    • getInt

      public static int getInt(String key, int defaultValue)
      Finds an int in IJ_Props or IJ_Prefs.txt.
    • getDouble

      public static double getDouble(String key, double defaultValue)
      Looks up a real number in IJ_Props or IJ_Prefs.txt.
    • getColor

      public static Color getColor(String key, Color defaultColor)
      Finds a color in IJ_Props or IJ_Prefs.txt.
    • getFileSeparator

      public static 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.
    • set

      public static void set(String key, String text)
      Saves the value of the string text in the preferences file using the keyword key. This string can be retrieved using the appropriate get() method.
    • set

      public static void set(String key, int value)
      Saves value in the preferences file using the keyword key. This value can be retrieved using the appropriate getPref() method.
    • set

      public static void set(String key, double value)
      Saves value in the preferences file using the keyword key. This value can be retrieved using the appropriate getPref() method.
    • set

      public static void set(String key, boolean value)
      Saves the boolean variable value in the preferences file using the keyword key. This value can be retrieved using the appropriate getPref() method.
    • get

      public static String get(String key, String defaultValue)
      Uses the keyword key to retrieve a string from the preferences file. Returns defaultValue if the key is not found.
    • get

      public static double get(String key, double defaultValue)
      Uses the keyword key to retrieve a number from the preferences file. Returns defaultValue if the key is not found.
    • get

      public static boolean get(String key, boolean defaultValue)
      Uses the keyword key to retrieve a boolean from the preferences file. Returns defaultValue if the key is not found.
    • saveLocation

      public static void saveLocation(String key, Point loc)
      Saves the Point loc in the preferences file as a string using the keyword key.
    • getLocation

      public static Point getLocation(String key)
      Uses the keyword key 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

      public static void savePrefs(Properties prefs, String path) throws IOException
      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

      public static Properties getControlPanelProperties()
    • defaultResultsExtension

      public static String defaultResultsExtension()