Class DistanceTransform3x3Short

java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.binary.distmap.DistanceTransform3x3Short
All Implemented Interfaces:
Algo, DistanceTransform

@Deprecated
public class DistanceTransform3x3Short
extends AlgoStub
implements DistanceTransform
Deprecated.
replaced by ChamferDistanceTransform2DShort (since 1.5.0)
Computes Chamfer distances in a 3x3 neighborhood using ShortProcessor object for storing result.

Example of use:


	short[] shortWeights = ChamferWeights.BORGEFORS.getShortWeights();
	boolean normalize = true;
	DistanceTransform dt = new DistanceTransform3x3Short(shortWeights, normalize);
	ImageProcessor result = dt.distanceMap(inputImage);
	// or:
	ImagePlus resultPlus = BinaryImages.distanceMap(imagePlus, shortWeights, normalize);
Author:
David Legland
See Also:
BinaryImages.distanceMap(ImageProcessor, short[], boolean), DistanceTransform, DistanceTransform3x3Float
  • Constructor Summary

    Constructors
    Constructor Description
    DistanceTransform3x3Short​(short[] weights)
    Deprecated.
    Default constructor that specifies the chamfer weights.
    DistanceTransform3x3Short​(short[] weights, boolean normalize)
    Deprecated.
    Constructor specifying the chamfer weights and the optional normalization.
    DistanceTransform3x3Short​(ChamferWeights weights, boolean normalize)
    Deprecated.
    Constructor specifying the chamfer weights and the optional normalization.
  • Method Summary

    Modifier and Type Method 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.

    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

    • DistanceTransform3x3Short

      public DistanceTransform3x3Short​(short[] weights)
      Deprecated.
      Default constructor that specifies the chamfer weights.
      Parameters:
      weights - an array of two weights for orthogonal and diagonal directions
    • DistanceTransform3x3Short

      public DistanceTransform3x3Short​(ChamferWeights weights, boolean normalize)
      Deprecated.
      Constructor specifying the chamfer weights and the optional normalization.
      Parameters:
      weights - an array of two weights for orthogonal and diagonal directions
      normalize - flag indicating whether the final distance map should be normalized by the first weight
    • DistanceTransform3x3Short

      public DistanceTransform3x3Short​(short[] weights, boolean normalize)
      Deprecated.
      Constructor specifying the chamfer weights and the optional normalization.
      Parameters:
      weights - an array of two weights for orthogonal and diagonal directions
      normalize - flag indicating whether the final distance map should be normalized by the first weight
  • Method Details

    • distanceMap

      public ij.process.ShortProcessor 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 interface DistanceTransform
      Parameters:
      labelImage - a label image with black pixels (0) as foreground
      Returns:
      a new instance of ShortProcessor containing:
      • 0 for each background pixel
      • the (strictly positive) distance to the nearest background pixel otherwise