Package inra.ijpb.label.distmap
Class ChamferDistanceTransform3DFloat
java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.label.distmap.ChamferDistanceTransform3DFloat
- All Implemented Interfaces:
Algo
,DistanceTransform3D
public class ChamferDistanceTransform3DFloat extends AlgoStub implements DistanceTransform3D
Computes 3D distance transform using the chamfer weights provided by a
ChamferWeights3D object, and using floating-point computation.
This version works also for label images. The implementation is a little bit
different compared to the version for binary images, in particular, it makes
use of the "Image3D" interface.
- Author:
- David Legland
- See Also:
ChamferDistanceTransform3DFloat
-
Constructor Summary
Constructors Constructor Description ChamferDistanceTransform3DFloat(ChamferMask3D mask)
Creates a new algorithm for computing 3D distance maps on label images based on a chamfer mask.ChamferDistanceTransform3DFloat(ChamferMask3D mask, boolean normalize)
Creates a new algorithm for computing 3D distance maps on label images based on a chamfer mask. -
Method Summary
Modifier and Type Method Description ij.ImageStack
distanceMap(ij.ImageStack image)
Computes the distance map from a 3D label 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
-
Constructor Details
-
ChamferDistanceTransform3DFloat
Creates a new algorithm for computing 3D distance maps on label images based on a chamfer mask. Use normalization of resulting distance map.- Parameters:
mask
- the chamfer mask used for propagating distances
-
ChamferDistanceTransform3DFloat
Creates a new algorithm for computing 3D distance maps on label images 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
-
distanceMap
public ij.ImageStack distanceMap(ij.ImageStack image)Computes the distance map from a 3D label image. Distance is computed for each foreground (white) pixel, as the chamfer distance to the nearest background (black) pixel.- Specified by:
distanceMap
in 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
-