Enum ChamferWeights

java.lang.Object
java.lang.Enum<ChamferWeights>
inra.ijpb.binary.ChamferWeights
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ChamferWeights>, java.lang.constant.Constable

@Deprecated
public enum ChamferWeights
extends java.lang.Enum<ChamferWeights>
Deprecated.
replaced by inra.ijpb.binary.distmap.ChamferMask2D (since 1.5.0)

A pre-defined set of weights that can be used to compute distance transform using chamfer approximations of Euclidean metric.

Provides methods to access weight values either as float array or as short array.

Example of use:


        short[] shortWeights = ChamferWeights.CHESSKNIGHT.getShortWeights();
        boolean normalize = true;
        DistanceTransform dt = new DistanceTransform5x5Short(shortWeights, normalize);
        ImageProcessor result = dt.distanceMap(inputImage);
        // or:
        ImagePlus resultPlus = BinaryImages.distanceMap(imagePlus, shortWeights, normalize);
 
See Also:
BinaryImages.distanceMap(ij.process.ImageProcessor, short[], boolean), BinaryImages.distanceMap(ij.process.ImageProcessor, float[], boolean), DistanceTransform
  • 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
    BORGEFORS
    Deprecated.
    Use weights 3 for orthogonal neighbors and 4 for diagonal neighbors (best approximation of Euclidean distance for 3-by-3 masks)
    CHESSBOARD
    Deprecated.
    Use weight equal to 1 for all neighbors
    CHESSKNIGHT
    Deprecated.
    Use weights 5 for orthogonal neighbors and 7 for diagonal neighbors, and 11 for chess-knight moves (best approximation for 5-by-5 masks).
    CITY_BLOCK
    Deprecated.
    Use weights 1 for orthogonal neighbors and 2 for diagonal neighbors
    QUASI_EUCLIDEAN
    Deprecated.
    Use weights 1 for orthogonal neighbors and sqrt(2) for diagonal neighbors.
    WEIGHTS_23
    Deprecated.
    Use weights 2 for orthogonal neighbors and 3 for diagonal neighbors
    WEIGHTS_57
    Deprecated.
    Use weights 5 for orthogonal neighbors and 7 for diagonal neighbors
  • Method Summary

    Modifier and Type Method Description
    static ChamferWeights fromLabel​(java.lang.String label)
    Deprecated.
    Determines the operation type from its label.
    static java.lang.String[] getAllLabels()
    Deprecated.
     
    float[] getFloatWeights()
    Deprecated.
     
    short[] getShortWeights()
    Deprecated.
     
    java.lang.String toString()
    Deprecated.
     
    static ChamferWeights valueOf​(java.lang.String name)
    Deprecated.
    Returns the enum constant of this type with the specified name.
    static ChamferWeights[] values()
    Deprecated.
    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

    • CHESSBOARD

      public static final ChamferWeights CHESSBOARD
      Deprecated.
      Use weight equal to 1 for all neighbors
    • CITY_BLOCK

      public static final ChamferWeights CITY_BLOCK
      Deprecated.
      Use weights 1 for orthogonal neighbors and 2 for diagonal neighbors
    • QUASI_EUCLIDEAN

      public static final ChamferWeights QUASI_EUCLIDEAN
      Deprecated.
      Use weights 1 for orthogonal neighbors and sqrt(2) for diagonal neighbors. Use 10 and 14 for short version.
    • BORGEFORS

      public static final ChamferWeights BORGEFORS
      Deprecated.
      Use weights 3 for orthogonal neighbors and 4 for diagonal neighbors (best approximation of Euclidean distance for 3-by-3 masks)
    • WEIGHTS_23

      public static final ChamferWeights WEIGHTS_23
      Deprecated.
      Use weights 2 for orthogonal neighbors and 3 for diagonal neighbors
    • WEIGHTS_57

      public static final ChamferWeights WEIGHTS_57
      Deprecated.
      Use weights 5 for orthogonal neighbors and 7 for diagonal neighbors
    • CHESSKNIGHT

      public static final ChamferWeights CHESSKNIGHT
      Deprecated.
      Use weights 5 for orthogonal neighbors and 7 for diagonal neighbors, and 11 for chess-knight moves (best approximation for 5-by-5 masks).
  • Method Details

    • values

      public static ChamferWeights[] values()
      Deprecated.
      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 ChamferWeights valueOf​(java.lang.String name)
      Deprecated.
      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
    • getShortWeights

      public short[] getShortWeights()
      Deprecated.
      Returns:
      the weights as shorts
    • getFloatWeights

      public float[] getFloatWeights()
      Deprecated.
      Returns:
      the weights as floats
    • toString

      public java.lang.String toString()
      Deprecated.
      Overrides:
      toString in class java.lang.Enum<ChamferWeights>
      Returns:
      the label associated to this chamfer weight
    • getAllLabels

      public static java.lang.String[] getAllLabels()
      Deprecated.
      Returns:
      all the chamfer weights labels
    • fromLabel

      public static ChamferWeights fromLabel​(java.lang.String label)
      Deprecated.
      Determines the operation type from its label.
      Parameters:
      label - the name of a chamfer weight
      Returns:
      the ChamferWeights enum corresponding to the given name
      Throws:
      java.lang.IllegalArgumentException - if label name is not recognized.