Package inra.ijpb.binary.distmap
Class DistanceTransform3x3Float
java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.binary.distmap.DistanceTransform3x3Float
- All Implemented Interfaces:
Algo
,DistanceTransform
@Deprecated public class DistanceTransform3x3Float extends AlgoStub implements DistanceTransform
Deprecated.
replaced by ChamferDistanceTransform2DFloat (since 1.5.0)
Computes Chamfer distances in a 3x3 neighborhood using a float array
for storing result.
Example of use:
float[] floatWeights = ChamferWeights.BORGEFORS.getFloatWeights();
boolean normalize = true;
DistanceTransform dt = new DistanceTransform3x3Float(floatWeights, normalize);
ImageProcessor result = dt.distanceMap(inputImage);
// or:
ImagePlus resultPlus = BinaryImages.distanceMap(imagePlus, floatWeights, normalize);
- Author:
- David Legland
- See Also:
BinaryImages.distanceMap(ImageProcessor, short[], boolean)
,DistanceTransform
,DistanceTransform3x3Short
-
Constructor Summary
Constructors Constructor Description DistanceTransform3x3Float(float[] weights)
Deprecated.Default constructor that specifies the chamfer weights.DistanceTransform3x3Float(float[] weights, boolean normalize)
Deprecated.Constructor specifying the chamfer weights and the optional normalization.DistanceTransform3x3Float(ChamferWeights weights, boolean normalize)
Deprecated.Constructor specifying the chamfer weights and the optional normalization. -
Method Summary
Modifier and Type Method Description ij.process.FloatProcessor
distanceMap(ij.process.ImageProcessor labelImage)
Deprecated.Computes the distance map of the distance to the nearest pixel with a different value.Methods inherited from class inra.ijpb.algo.AlgoStub
addAlgoListener, removeAlgoListener
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface inra.ijpb.algo.Algo
addAlgoListener, removeAlgoListener
-
Constructor Details
-
DistanceTransform3x3Float
public DistanceTransform3x3Float(float[] weights)Deprecated.Default constructor that specifies the chamfer weights.- Parameters:
weights
- an array of two weights for orthogonal and diagonal directions
-
DistanceTransform3x3Float
Deprecated.Constructor specifying the chamfer weights and the optional normalization.- Parameters:
weights
- an array of two weights for orthogonal and diagonal directionsnormalize
- flag indicating whether the final distance map should be normalized by the first weight
-
DistanceTransform3x3Float
public DistanceTransform3x3Float(float[] weights, boolean normalize)Deprecated.Constructor specifying the chamfer weights and the optional normalization.- Parameters:
weights
- an array of two weights for orthogonal and diagonal directionsnormalize
- flag indicating whether the final distance map should be normalized by the first weight
-
-
Method Details
-
distanceMap
public ij.process.FloatProcessor distanceMap(ij.process.ImageProcessor labelImage)Deprecated.Computes the distance map of the distance to the nearest pixel with a different value. The function returns a new short processor the same size as the input, with values greater or equal to zero.- Specified by:
distanceMap
in interfaceDistanceTransform
- Parameters:
labelImage
- a label image with black pixels (0) as foreground- Returns:
- a new instance of FloatProcessor containing:
- 0 for each background pixel
- the (strictly positive) distance to the nearest background pixel otherwise
-