Enum Strel3D.Shape

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

public static enum Strel3D.Shape
extends java.lang.Enum<Strel3D.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
    BALL
    Ball of a given radius
    CUBE
    Cube of a given side
    DIAMOND
    Diamond of a given diameter
    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
    LINE_Z
    3D line in the Z direction
    OCTAGON
    Octagon of a given diameter
    SQUARE
    Square of a given side
  • Method Summary

    Modifier and Type Method Description
    Strel3D fromDiameter​(int diam)
    Creates a structuring element of the given type and with the specified diameter.
    Strel3D fromDiameterList​(int diamX, int diamY, int diamZ)
    Creates a structuring element of the given type and with the specified diameter.
    static Strel3D.Shape fromLabel​(java.lang.String label)
    Determines the strel shape from its label.
    Strel3D fromRadius​(int radius)
    Creates a structuring element of the given type and with the specified radius.
    Strel3D fromRadiusList​(int radiusX, int radiusY, int radiusZ)
    Creates a structuring element of the given type and with the specified radius for each dimension.
    static java.lang.String[] getAllLabels()
    Returns a set of labels for most of classical structuring elements.
    java.lang.String toString()
    Returns the label associated to this shape.
    static Strel3D.Shape valueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static Strel3D.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 Strel3D.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 Strel3D.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()
      Returns the label associated to this shape.
      Overrides:
      toString in class java.lang.Enum<Strel3D.Shape>
    • fromRadius

      public Strel3D 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
    • fromRadiusList

      public Strel3D fromRadiusList​(int radiusX, int radiusY, int radiusZ)
      Creates a structuring element of the given type and with the specified radius for each dimension. The final size is given for each dimension by 2 * radius + 1, to take into account the central pixel.
      Parameters:
      radiusX - the radius of the structuring element in the x-direction, in pixels
      radiusY - the radius of the structuring element in the y-direction, in pixels
      radiusZ - the radius of the structuring element in the z-direction, in pixels
      Returns:
      a new structuring element
    • fromDiameter

      public Strel3D 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
    • fromDiameterList

      public Strel3D fromDiameterList​(int diamX, int diamY, int diamZ)
      Creates a structuring element of the given type and with the specified diameter.
      Parameters:
      diamX - the diameter of the structuring element in the X direction
      diamY - the diameter of the structuring element in the Y direction
      diamZ - the diameter of the structuring element in the Z direction
      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 Strel3D.Shape fromLabel​(java.lang.String label)
      Determines the strel shape from its label.
      Parameters:
      label - the name of the structuring element
      Returns:
      a Shape object that can be used to instantiate new structuring elements
      Throws:
      java.lang.IllegalArgumentException - if label is not recognized.