Enum Class MaskMode

java.lang.Object
java.lang.Enum<MaskMode>
com.xinapse.multisliceimage.roi.MaskMode
All Implemented Interfaces:
Serializable, Comparable<MaskMode>, Constable

public enum MaskMode extends Enum<MaskMode>
An enumeration of possible masking mode. The masking mode determines how much of a pixel must be within an ROI (as a percentage of the pixels's area) for that pixel to be "inside" the ROI.
  • Enum Constant Details

    • ANY

      public static final MaskMode ANY
      MaskMode such that if any part of a pixel is inside an ROI, that pixel is part of the mask.
    • HALF

      public static final MaskMode HALF
      MaskMode such that if at least 50% of a pixel is inside an ROI, that pixel is part of the mask.
    • ALL

      public static final MaskMode ALL
      MaskMode such that all of a pixel must be inside an ROI for that pixel to be part of the mask.
  • Method Details

    • values

      public static MaskMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MaskMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getInstance

      public static MaskMode getInstance(String modeString) throws InvalidArgumentException
      Returns a MaskMode corresponding to the supplied String.
      Parameters:
      modeString - the String from which the MaskMode will be interpreted.
      Returns:
      the mask mode whose name matches the supplied String.
      Throws:
      InvalidArgumentException - if the supplied String does not match any mask mode name.
    • getToolTipString

      public String getToolTipString()
      Returns a String that is useful for building a ToolTip or description of this MaskMode.
      Returns:
      a String that is useful for building a ToolTip or description of this MaskMode.
    • threshold

      public double threshold()
      Returns the pixel area threshold for this MaskMode as a fraction of the pixel's area.
      Returns:
      the fraction of a pixel's area that must be within an ROI for that pixel to be part of the mask.
    • savePreferences

      public static void savePreferences(MaskMode maskMode, Preferences prefs)
      Saves the supplied MaskMode as the user's preferrred MaskMode.
      Parameters:
      maskMode - the MaskMode to save in the user's preferences.
      prefs - the user Preferences in which to save the MaskMode.
    • getPreferredMaskMode

      public static MaskMode getPreferredMaskMode(Preferences prefs, MaskMode defaultMaskMode)
      Returns the MaskMode set in the UserPreferences, or the default MaskMode, if none is set in the Preferences.
      Parameters:
      prefs - the user Preferences in which to look for the preferred MaskMode.
      defaultMaskMode - the default to return if the preferred MaskMode cannot be found in the user Preferences.
      Returns:
      the user's preferred MaskMode.