Class DistanceTransform5x5Short

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

@Deprecated
public class DistanceTransform5x5Short
extends AlgoStub
implements DistanceTransform
Deprecated.
replaced by ChamferDistanceTransform2DShort (since 1.5.0)

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);
Author:
David Legland
See Also:
BinaryImages.distanceMap(ImageProcessor, short[], boolean), DistanceTransform5x5Float, DistanceTransform
  • Constructor Summary

    Constructors
    Constructor Description
    DistanceTransform5x5Short()
    Deprecated.
    Default constructor with predefined chamfer weights.
    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.
    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.
  • 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

    • DistanceTransform5x5Short

      public DistanceTransform5x5Short()
      Deprecated.
      Default constructor with predefined chamfer weights.
    • DistanceTransform5x5Short

      public DistanceTransform5x5Short​(ChamferWeights weights)
      Deprecated.
      Constructor specifying the chamfer weights and the optional normalization.
      Parameters:
      weights - a set of chamfer weights with at least three values
    • DistanceTransform5x5Short

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

      public DistanceTransform5x5Short​(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
    • DistanceTransform5x5Short

      public DistanceTransform5x5Short​(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