Package inra.ijpb.binary.geodesic
Class GeodesicDistanceTransformShort
java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.binary.geodesic.GeodesicDistanceTransformShort
- All Implemented Interfaces:
Algo
,GeodesicDistanceTransform
public class GeodesicDistanceTransformShort extends AlgoStub implements GeodesicDistanceTransform
Computation of geodesic distances based on a chamfer mask using short integer
array for storing result.
The maximum propagated distance is limited to Short.MAX_VALUE.
All computations are performed using integers, results are stored as shorts.
This implementation is based on iteration of forward-backward passes, until
idempotence. The "hybrid" implementation is usually more efficient for
complex images.
- Author:
- David Legland
- See Also:
GeodesicDistanceTransformShortHybrid
,GeodesicDistanceTransformFloat
-
Field Summary
Fields Modifier and Type Field Description static short
BACKGROUND
The value associated to the background in the result image.static short
MAX_DIST
The value used to initialize the distance map. -
Constructor Summary
Constructors Constructor Description GeodesicDistanceTransformShort(short[] weights)
Deprecated.should use an instance of ChamferMask2D at constructionGeodesicDistanceTransformShort(short[] weights, boolean normalizeMap)
Deprecated.should use an instance of ChamferMask2D at constructionGeodesicDistanceTransformShort(ChamferMask2D mask)
Creates a new algorithm for propagating geodesic distances.GeodesicDistanceTransformShort(ChamferMask2D mask, boolean normalizeMap)
Creates a new algorithm for propagating geodesic distances. -
Method Summary
Modifier and Type Method Description ij.process.ImageProcessor
geodesicDistanceMap(ij.process.ImageProcessor marker, ij.process.ImageProcessor labelImage)
Computes the geodesic distance function for each pixel in mask label image, using the given binary marker image.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
-
Field Details
-
MAX_DIST
public static final short MAX_DISTThe value used to initialize the distance map.- See Also:
- Constant Field Values
-
BACKGROUND
public static final short BACKGROUNDThe value associated to the background in the result image.- See Also:
- Constant Field Values
-
-
Constructor Details
-
GeodesicDistanceTransformShort
Creates a new algorithm for propagating geodesic distances.- Parameters:
mask
- the chamfer mask to use for propagating distances
-
GeodesicDistanceTransformShort
Creates a new algorithm for propagating geodesic distances.- Parameters:
mask
- the chamfer mask to use for propagating distancesnormalizeMap
- the flag for normalization
-
GeodesicDistanceTransformShort
@Deprecated public GeodesicDistanceTransformShort(short[] weights)Deprecated.should use an instance of ChamferMask2D at constructionCreates a new algorithm for propagating geodesic distances.- Parameters:
weights
- the weights to use for propagating distances
-
GeodesicDistanceTransformShort
@Deprecated public GeodesicDistanceTransformShort(short[] weights, boolean normalizeMap)Deprecated.should use an instance of ChamferMask2D at constructionCreates a new algorithm for propagating geodesic distances.- Parameters:
weights
- the weights to use for propagating distancesnormalizeMap
- the flag for normalization
-
-
Method Details
-
geodesicDistanceMap
public ij.process.ImageProcessor geodesicDistanceMap(ij.process.ImageProcessor marker, ij.process.ImageProcessor labelImage)Computes the geodesic distance function for each pixel in mask label image, using the given binary marker image. Mask and marker should be ImageProcessor the same size and containing integer values. The function returns a new ShortProcessor the same size as the input, with values greater or equal to zero.- Specified by:
geodesicDistanceMap
in interfaceGeodesicDistanceTransform
- Parameters:
marker
- the binary marker imagelabelImage
- the label image used as mask- Returns:
- the geodesic distance map from the marker image within each label of the mask
- See Also:
GeodesicDistanceTransform.geodesicDistanceMap(ij.process.ImageProcessor, ij.process.ImageProcessor)
-