Package inra.ijpb.binary
Enum ChamferWeights3D
java.lang.Object
java.lang.Enum<ChamferWeights3D>
inra.ijpb.binary.ChamferWeights3D
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ChamferWeights3D>
,java.lang.constant.Constable
@Deprecated public enum ChamferWeights3D extends java.lang.Enum<ChamferWeights3D>
Deprecated.
replaced by inra.ijpb.binary.distmap.ChamferMask2D (since 1.5.0)
A pre-defined set of weights that can be used to compute 3D 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:
float[] floatWeights = ChamferWeights3D.BORGEFORS.getFloatWeights();
boolean normalize = true;
DistanceTransform3D dt = new DistanceTransform3DFloat(floatWeights, normalize);
ImageStack result = dt.distanceMap(inputStack);
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ChamferWeights3D.FloatOffset
Deprecated.static class
ChamferWeights3D.ShortOffset
Deprecated.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, and 5 for cube-diagonals (best approximation for 3-by-3-by-3 masks).CHESSBOARD
Deprecated.Use weight equal to 1 for all neighborsCITY_BLOCK
Deprecated.Use weights 1 for orthogonal neighbors and 2 for diagonal neighbors, and 3 for cube-diagonals.QUASI_EUCLIDEAN
Deprecated.Use weights 1 for orthogonal neighbors and sqrt(2) for diagonal neighbors, and sqrt(3) for cube-diagonals.WEIGHTS_3_4_5_7
Deprecated.Use weights 3 for orthogonal neighbors and 4 for diagonal neighbors, and 5 for cube-diagonals, and 7 for (2,1,1) shifts. -
Method Summary
Modifier and Type Method Description static ChamferWeights3D
fromLabel(java.lang.String label)
Deprecated.Determines the operation type from its label.static java.lang.String[]
getAllLabels()
Deprecated.static java.util.Collection<ChamferWeights3D.FloatOffset>
getBackwardOffsets(float[] weights)
Deprecated.Computes the collection of weighted offsets corresponding to a scan of the voxels in a 3D image in the backward direction.static java.util.Collection<ChamferWeights3D.ShortOffset>
getBackwardOffsets(short[] weights)
Deprecated.Computes the collection of weighted offsets corresponding to a scan of the voxels in a 3D image in the backward direction.float[]
getFloatWeights()
Deprecated.static java.util.Collection<ChamferWeights3D.FloatOffset>
getForwardOffsets(float[] weights)
Deprecated.Computes the collection of weighted offsets corresponding to a scan of the voxels in a 3D image in the forward direction.static java.util.Collection<ChamferWeights3D.ShortOffset>
getForwardOffsets(short[] weights)
Deprecated.Computes the collection of weighted offsets corresponding to a scan of the voxels in a 3D image in the forward direction.short[]
getShortWeights()
Deprecated.java.lang.String
toString()
Deprecated.static ChamferWeights3D
valueOf(java.lang.String name)
Deprecated.Returns the enum constant of this type with the specified name.static ChamferWeights3D[]
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
Deprecated.Use weight equal to 1 for all neighbors -
CITY_BLOCK
Deprecated.Use weights 1 for orthogonal neighbors and 2 for diagonal neighbors, and 3 for cube-diagonals. -
QUASI_EUCLIDEAN
Deprecated.Use weights 1 for orthogonal neighbors and sqrt(2) for diagonal neighbors, and sqrt(3) for cube-diagonals. Use 10, 14 and 17 for short version. -
BORGEFORS
Deprecated.Use weights 3 for orthogonal neighbors and 4 for diagonal neighbors, and 5 for cube-diagonals (best approximation for 3-by-3-by-3 masks). -
WEIGHTS_3_4_5_7
Deprecated.Use weights 3 for orthogonal neighbors and 4 for diagonal neighbors, and 5 for cube-diagonals, and 7 for (2,1,1) shifts. Good approximation using only four weights, and keeping low value of orthogonal weight.
-
-
Method Details
-
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
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 namejava.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 classjava.lang.Enum<ChamferWeights3D>
- Returns:
- the label associated to this chamfer weight
-
getAllLabels
public static java.lang.String[] getAllLabels()Deprecated.- Returns:
- all the chamfer weights labels
-
fromLabel
Deprecated.Determines the operation type from its label.- Parameters:
label
- the name of a chamfer weight- Returns:
- the ChamferWeights3D enum corresponding to the given name
- Throws:
java.lang.IllegalArgumentException
- if label name is not recognized.
-
getForwardOffsets
public static java.util.Collection<ChamferWeights3D.ShortOffset> getForwardOffsets(short[] weights)Deprecated.Computes the collection of weighted offsets corresponding to a scan of the voxels in a 3D image in the forward direction. The number of offsets depends on the number of weights (3 or 4 weights are required):- the first weight corresponds to a step in the orthogonal directions (three offsets).
- the second weight corresponds to a step in a diagonal direction within a plane (six offsets).
- the third weight corresponds to a step in a cube-diagonal direction (four offsets).
- the (optional) fourth weight corresponds to a step in a permutation of the (2,1,1) vector (twelve offsets).
- Parameters:
weights
- an array of (short) weights, corresponding to orthogonal, diagonal, and optionally more neighbors.- Returns:
- a collection of offset encapsulating the shift in x, y and z directions, and the associated weight.
- See Also:
getForwardOffsets(float[])
,getBackwardOffsets(short[])
-
getForwardOffsets
public static java.util.Collection<ChamferWeights3D.FloatOffset> getForwardOffsets(float[] weights)Deprecated.Computes the collection of weighted offsets corresponding to a scan of the voxels in a 3D image in the forward direction. The number of offsets depends on the number of weights (3 or 4 weights are required):- the first weight corresponds to a step in the orthogonal directions (three offsets).
- the second weight corresponds to a step in a diagonal direction within a plane (six offsets).
- the third weight corresponds to a step in a cube-diagonal direction (four offsets).
- the (optional) fourth weight corresponds to a step in a permutation of the (2,1,1) vector (twelve offsets).
- Parameters:
weights
- an array of (short) weights, corresponding to orthogonal, diagonal, and optionally more neighbors.- Returns:
- a collection of offset encapsulating the shift in x, y and z directions, and the associated weight.
- See Also:
getForwardOffsets(short[])
,getBackwardOffsets(float[])
-
getBackwardOffsets
public static java.util.Collection<ChamferWeights3D.ShortOffset> getBackwardOffsets(short[] weights)Deprecated.Computes the collection of weighted offsets corresponding to a scan of the voxels in a 3D image in the backward direction. The number of offsets depends on the number of weights (3 or 4 weights are required):- the first weight corresponds to a step in the orthogonal directions (three offsets).
- the second weight corresponds to a step in a diagonal direction within a plane (six offsets).
- the third weight corresponds to a step in a cube-diagonal direction (four offsets).
- the (optional) fourth weight corresponds to a step in a permutation of the (2,1,1) vector (twelve offsets).
- Parameters:
weights
- an array of (short) weights, corresponding to orthogonal, diagonal, and optionally more neighbors.- Returns:
- a collection of offset encapsulating the shift in x, y and z directions, and the associated weight.
- See Also:
getForwardOffsets(short[])
-
getBackwardOffsets
public static java.util.Collection<ChamferWeights3D.FloatOffset> getBackwardOffsets(float[] weights)Deprecated.Computes the collection of weighted offsets corresponding to a scan of the voxels in a 3D image in the backward direction. The number of offsets depends on the number of weights (3 or 4 weights are required):- the first weight corresponds to a step in the orthogonal directions (three offsets).
- the second weight corresponds to a step in a diagonal direction within a plane (six offsets).
- the third weight corresponds to a step in a cube-diagonal direction (four offsets).
- the (optional) fourth weight corresponds to a step in a permutation of the (2,1,1) vector (twelve offsets).
- Parameters:
weights
- an array of (short) weights, corresponding to orthogonal, diagonal, and optionally more neighbors.- Returns:
- a collection of offset encapsulating the shift in x, y and z directions, and the associated weight.
- See Also:
getForwardOffsets(short[])
-