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-Hat
    CLOSING
    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

      public static final Morphology.Operation EROSION
      Morphological erosion (local minima)
    • DILATION

      public static final Morphology.Operation DILATION
      Morphological dilation (local maxima)
    • OPENING

      public static final Morphology.Operation OPENING
      Morphological opening (erosion followed by dilation)
    • CLOSING

      public static final Morphology.Operation CLOSING
      Morphological closing (dilation followed by erosion)
    • TOPHAT

      public static final Morphology.Operation TOPHAT
      White Top-Hat
    • BOTTOMHAT

      public static final Morphology.Operation BOTTOMHAT
      Black Top-Hat
    • GRADIENT

      public static final Morphology.Operation GRADIENT
      Morphological gradient (difference of dilation with erosion)
    • LAPLACIAN

      public static final Morphology.Operation LAPLACIAN
      Morphological laplacian (difference of external gradient with internal gradient)
    • INTERNAL_GRADIENT

      public static final Morphology.Operation INTERNAL_GRADIENT
      Morphological internal gradient (difference of dilation with original image)
    • EXTERNAL_GRADIENT

      public static final Morphology.Operation EXTERNAL_GRADIENT
      Morphological internal gradient (difference of original image with erosion)
  • Method Details

    • values

      public static Morphology.Operation[] 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

      public static Morphology.Operation valueOf​(java.lang.String name)
      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 name
      java.lang.NullPointerException - if the argument is null
    • apply

      public ij.process.ImageProcessor apply​(ij.process.ImageProcessor image, Strel strel)
      Applies the current operator to the input image.
      Parameters:
      image - the image to process
      strel - the structuring element to use
      Returns:
      the result of morphological operation applied to image
    • apply

      public ij.ImageStack apply​(ij.ImageStack image, Strel3D strel)
      Applies the current operator to the input 3D image.
      Parameters:
      image - the image to process
      strel - the structuring element to use
      Returns:
      the result of morphological operation applied to image
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.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

      public static Morphology.Operation fromLabel​(java.lang.String opLabel)
      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.