Enum Strel.Shape

java.lang.Object
java.lang.Enum<Strel.Shape>
inra.ijpb.morphology.Strel.Shape
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Strel.Shape>, java.lang.constant.Constable
Enclosing interface:
Strel

public static enum Strel.Shape
extends java.lang.Enum<Strel.Shape>
An enumeration of the different possible structuring element shapes. Each item of the enumeration can create Strel instances of specific class and of given size.
  • 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
    DIAMOND
    Diamond of a given diameter
    DISK
    Disk of a given radius
    LINE_DIAG_DOWN
    Diagonal line of a given length
    LINE_DIAG_UP
    Diagonal line of a given length
    LINE_HORIZ
    Horizontal line of a given length
    LINE_VERT
    Vertical line of a given length
    OCTAGON
    Octagon of a given diameter
    SQUARE
    Square of a given side
  • Method Summary

    Modifier and Type Method Description
    Strel fromDiameter​(int diam)
    Creates a structuring element of the given type and with the specified diameter.
    static Strel.Shape fromLabel​(java.lang.String label)
    Determines the strel shape from its label.
    Strel fromRadius​(int radius)
    Creates a structuring element of the given type and with the specified radius.
    static java.lang.String[] getAllLabels()
    Returns a set of labels for most of classical structuring elements.
    java.lang.String toString()  
    static Strel.Shape valueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static Strel.Shape[] 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

  • Method Details

    • values

      public static Strel.Shape[] 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 Strel.Shape 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
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Enum<Strel.Shape>
      Returns:
      the label associated to this shape.
    • fromRadius

      public Strel fromRadius​(int radius)
      Creates a structuring element of the given type and with the specified radius. The final size is given by 2 * radius + 1, to take into account the central pixel.
      Parameters:
      radius - the radius of the structuring element, in pixels
      Returns:
      a new structuring element
    • fromDiameter

      public Strel fromDiameter​(int diam)
      Creates a structuring element of the given type and with the specified diameter.
      Parameters:
      diam - the orthogonal diameter of the structuring element (max of x and y sizes), in pixels
      Returns:
      a new structuring element
    • getAllLabels

      public static java.lang.String[] getAllLabels()
      Returns a set of labels for most of classical structuring elements.
      Returns:
      a list of labels
    • fromLabel

      public static Strel.Shape fromLabel​(java.lang.String label)
      Determines the strel shape from its label.
      Parameters:
      label - the shape name of the structuring element
      Returns:
      a new Shape instance that can be used to create structuring elements
      Throws:
      java.lang.IllegalArgumentException - if label is not recognized.