@Deprecated public class DistanceTransform5x5Short extends AlgoStub implements DistanceTransform
Computes Chamfer distances in a 5x5 neighborhood using a ShortProcessor object for storing result.
Uses 5x5 chamfer map, with two passes (one forward, one backward). Three different weights are provided for orthogonal, diagonal, and "chess-knight" moves. Weights equal to (5,7,11) usually give nice results.
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);
BinaryImages.distanceMap(ImageProcessor, short[], boolean)
,
DistanceTransform5x5Float
,
DistanceTransform
Constructor and Description |
---|
DistanceTransform5x5Short()
Deprecated.
Default constructor with predefined chamfer weights.
|
DistanceTransform5x5Short(ChamferWeights weights)
Deprecated.
Constructor specifying the chamfer weights and the optional
normalization.
|
DistanceTransform5x5Short(ChamferWeights weights,
boolean normalize)
Deprecated.
Constructor specifying the chamfer weights and the optional
normalization.
|
DistanceTransform5x5Short(short[] weights)
Deprecated.
Default constructor that specifies the chamfer weights.
|
DistanceTransform5x5Short(short[] weights,
boolean normalize)
Deprecated.
Constructor specifying the chamfer weights and the optional normalization.
|
Modifier and Type | Method and Description |
---|---|
ij.process.ShortProcessor |
distanceMap(ij.process.ImageProcessor labelImage)
Deprecated.
Computes the distance map of the distance to the nearest pixel with a
different value.
|
addAlgoListener, fireProgressChanged, fireProgressChanged, fireStatusChanged, fireStatusChanged, removeAlgoListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAlgoListener, removeAlgoListener
public DistanceTransform5x5Short()
public DistanceTransform5x5Short(ChamferWeights weights)
weights
- a set of chamfer weights with at least three valuespublic DistanceTransform5x5Short(short[] weights)
weights
- an array of two weights for orthogonal and diagonal directionspublic DistanceTransform5x5Short(ChamferWeights weights, boolean normalize)
weights
- an array of two weights for orthogonal and diagonal directionsnormalize
- flag indicating whether the final distance map should be
normalized by the first weightpublic DistanceTransform5x5Short(short[] weights, boolean normalize)
weights
- an array of two weights for orthogonal and diagonal directionsnormalize
- flag indicating whether the final distance map should be
normalized by the first weightpublic ij.process.ShortProcessor distanceMap(ij.process.ImageProcessor labelImage)
distanceMap
in interface DistanceTransform
labelImage
- a label image with black pixels (0) as foregroundCopyright © 2014–2023 INRA-IJPB Modeling and Digital Imaging lab. All rights reserved.