Package inra.ijpb.morphology
Enum Morphology.Operation
java.lang.Object
java.lang.Enum<Morphology.Operation>
inra.ijpb.morphology.Morphology.Operation
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Morphology.Operation>
,java.lang.constant.Constable
- Enclosing class:
- Morphology
public static enum Morphology.Operation extends java.lang.Enum<Morphology.Operation>
A pre-defined set of basis morphological operations, that can be easily
used with a GenericDialog.
Example:
// Use a generic dialog to define an operator
GenericDialog gd = new GenericDialog();
gd.addChoice("Operation", Operation.getAllLabels();
gd.showDialog();
Operation op = Operation.fromLabel(gd.getNextChoice());
// Apply the operation on the current image
ImageProcessor image = IJ.getImage().getProcessor();
op.apply(image, SquareStrel.fromRadius(2));
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
-
Enum Constant Summary
Enum Constants Enum Constant Description BOTTOMHAT
Black Top-HatCLOSING
Morphological closing (dilation followed by erosion)DILATION
Morphological dilation (local maxima)EROSION
Morphological erosion (local minima)EXTERNAL_GRADIENT
Morphological internal gradient (difference of original image with erosion)GRADIENT
Morphological gradient (difference of dilation with erosion)INTERNAL_GRADIENT
Morphological internal gradient (difference of dilation with original image)LAPLACIAN
Morphological laplacian (difference of external gradient with internal gradient)OPENING
Morphological opening (erosion followed by dilation)TOPHAT
White Top-Hat -
Method Summary
Modifier and Type Method Description ij.ImageStack
apply(ij.ImageStack image, Strel3D strel)
Applies the current operator to the input 3D image.ij.process.ImageProcessor
apply(ij.process.ImageProcessor image, Strel strel)
Applies the current operator to the input image.static Morphology.Operation
fromLabel(java.lang.String opLabel)
Determines the operation type from its label.static java.lang.String[]
getAllLabels()
Returns the list of labels for this enumeration.java.lang.String
toString()
static Morphology.Operation
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Morphology.Operation[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
-
Enum Constant Details
-
EROSION
Morphological erosion (local minima) -
DILATION
Morphological dilation (local maxima) -
OPENING
Morphological opening (erosion followed by dilation) -
CLOSING
Morphological closing (dilation followed by erosion) -
TOPHAT
White Top-Hat -
BOTTOMHAT
Black Top-Hat -
GRADIENT
Morphological gradient (difference of dilation with erosion) -
LAPLACIAN
Morphological laplacian (difference of external gradient with internal gradient) -
INTERNAL_GRADIENT
Morphological internal gradient (difference of dilation with original image) -
EXTERNAL_GRADIENT
Morphological internal gradient (difference of original image with erosion)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
apply
Applies the current operator to the input image.- Parameters:
image
- the image to processstrel
- the structuring element to use- Returns:
- the result of morphological operation applied to image
-
apply
Applies the current operator to the input 3D image.- Parameters:
image
- the image to processstrel
- the structuring element to use- Returns:
- the result of morphological operation applied to image
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Enum<Morphology.Operation>
-
getAllLabels
public static java.lang.String[] getAllLabels()Returns the list of labels for this enumeration.- Returns:
- the list of labels for this enumeration.
-
fromLabel
Determines the operation type from its label.- Parameters:
opLabel
- the label of the operation- Returns:
- the parsed Operation
- Throws:
java.lang.IllegalArgumentException
- if label is not recognized.
-