Package com.xinapse.multisliceimage.roi
Enum Class MaskMode
- All Implemented Interfaces:
Serializable
,Comparable<MaskMode>
,Constable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionMaskMode
such that all of a pixel must be inside an ROI for that pixel to be part of the mask.MaskMode
such that if any part of a pixel is inside an ROI, that pixel is part of the mask.MaskMode
such that if at least 50% of a pixel is inside an ROI, that pixel is part of the mask. -
Method Summary
Modifier and TypeMethodDescriptionstatic MaskMode
getInstance
(String modeString) Returns a MaskMode corresponding to the supplied String.static MaskMode
getPreferredMaskMode
(Preferences prefs, MaskMode defaultMaskMode) Returns a String that is useful for building a ToolTip or description of this MaskMode.static void
savePreferences
(MaskMode maskMode, Preferences prefs) Saves the suppliedMaskMode
as the user's preferrred MaskMode.double
Returns the pixel area threshold for this MaskMode as a fraction of the pixel's area.static MaskMode
Returns the enum constant of this class with the specified name.static MaskMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ANY
MaskMode
such that if any part of a pixel is inside an ROI, that pixel is part of the mask. -
HALF
MaskMode
such that if at least 50% of a pixel is inside an ROI, that pixel is part of the mask. -
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
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
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 nameNullPointerException
- if the argument is null
-
getInstance
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
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
Saves the suppliedMaskMode
as the user's preferrred MaskMode. -
getPreferredMaskMode
-