Package inra.ijpb.binary.distmap
Class ChamferDistanceTransform3DShort
java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.binary.distmap.ChamferDistanceTransform3DShort
- All Implemented Interfaces:
Algo,ChamferDistanceTransform3D,DistanceTransform3D
public class ChamferDistanceTransform3DShort extends AlgoStub implements ChamferDistanceTransform3D
Computes 3D distance transform using the chamfer weights provided by a
ChamferMask3D object, and using 16-bits integer computation.
- Author:
- David Legland
-
Constructor Summary
Constructors Constructor Description ChamferDistanceTransform3DShort(ChamferMask3D mask)Creates a new algorithm for computing 3D distance maps based on a chamfer mask.ChamferDistanceTransform3DShort(ChamferMask3D mask, boolean normalize)Creates a new algorithm for computing 3D distance maps based on a chamfer mask. -
Method Summary
Modifier and Type Method Description ij.ImageStackdistanceMap(ij.ImageStack image)Computes the distance map from a 3D binary image.ChamferMask3Dmask()Methods inherited from class inra.ijpb.algo.AlgoStub
addAlgoListener, removeAlgoListenerMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface inra.ijpb.algo.Algo
addAlgoListener, removeAlgoListener
-
Constructor Details
-
ChamferDistanceTransform3DShort
Creates a new algorithm for computing 3D distance maps based on a chamfer mask.- Parameters:
mask- the chamfer mask to use for propagating distances
-
ChamferDistanceTransform3DShort
Creates a new algorithm for computing 3D distance maps based on a chamfer mask.- Parameters:
mask- the chamfer mask to use for propagating distancesnormalize- whether distance map should be normalized by the weight associated to orthogonal shifts
-
-
Method Details
-
mask
- Specified by:
maskin interfaceChamferDistanceTransform3D- Returns:
- the chamfer mask used by this distance transform algorithm.
-
distanceMap
public ij.ImageStack distanceMap(ij.ImageStack image)Computes the distance map from a 3D binary image. Distance is computed for each foreground (white) pixel, as the chamfer distance to the nearest background (black) pixel.- Specified by:
distanceMapin interfaceDistanceTransform3D- Parameters:
image- a 3D binary image with white pixels (255) as foreground- Returns:
- a new 3D image containing:
- 0 for each background pixel
- the distance to the nearest background pixel otherwise
-