Package inra.ijpb.binary.conncomp
Class FloodFillComponentsLabeling3D
java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.binary.conncomp.FloodFillComponentsLabeling3D
- All Implemented Interfaces:
Algo
,ConnectedComponentsLabeling3D
public class FloodFillComponentsLabeling3D extends AlgoStub implements ConnectedComponentsLabeling3D
Computes the labels of the connected components in a 3D binary image. The
type of result is controlled by the bitDepth option.
Uses a Flood-fill type algorithm. The image voxels are iterated, and each
time a foreground voxel not yet associated with a label is encountered, its
connected component is associated with a new label.
Example of use:
int conn = 6;
int bitDepth = 16;
FloodFillComponentsLabeling3D algo = new FloodFillComponentsLabeling3D(conn, bitDepth);
DefaultAlgoListener.monitor(algo);
ImageStack labels = algo.computeLabels(image);
// or:
FloodFillComponentsLabeling3D.Result res = algo.computeResult(image);
ImageStack labels = res.labelMap;
- Author:
- dlegland
- See Also:
FloodFillComponentsLabeling
,FloodFill3D
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
FloodFillComponentsLabeling3D.Result
Data class that stores result of connected component labeling. -
Constructor Summary
Constructors Constructor Description FloodFillComponentsLabeling3D()
Constructor with default connectivity 6 and default output bitdepth equal to 16.FloodFillComponentsLabeling3D(int connectivity)
Constructor specifying the connectivity and using default output bitdepth equal to 16.FloodFillComponentsLabeling3D(int connectivity, int bitDepth)
Constructor specifying the connectivity and the bitdepth of result label image -
Method Summary
Modifier and Type Method Description ij.ImageStack
computeLabels(ij.ImageStack image)
Computes labels corresponding to connected components in input image.FloodFillComponentsLabeling3D.Result
computeResult(ij.ImageStack image)
Computes connected components labeling on the input binary image, and returns the results encapsulated into aResult
class together with the largest label index.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
-
FloodFillComponentsLabeling3D
public FloodFillComponentsLabeling3D()Constructor with default connectivity 6 and default output bitdepth equal to 16. -
FloodFillComponentsLabeling3D
public FloodFillComponentsLabeling3D(int connectivity)Constructor specifying the connectivity and using default output bitdepth equal to 16.- Parameters:
connectivity
- the connectivity of connected components (6 or 26)
-
FloodFillComponentsLabeling3D
public FloodFillComponentsLabeling3D(int connectivity, int bitDepth)Constructor specifying the connectivity and the bitdepth of result label image- Parameters:
connectivity
- the connectivity of connected components (6 or 26)bitDepth
- the bit depth of the result (8, 16, or 32)
-
-
Method Details
-
computeLabels
public ij.ImageStack computeLabels(ij.ImageStack image)Description copied from interface:ConnectedComponentsLabeling3D
Computes labels corresponding to connected components in input image.- Specified by:
computeLabels
in interfaceConnectedComponentsLabeling3D
- Parameters:
image
- binary image containing components- Returns:
- the label image of the components
-
computeResult
Computes connected components labeling on the input binary image, and returns the results encapsulated into aResult
class together with the largest label index.- Parameters:
image
- the input binary image- Returns:
- an instance of the Result class that can be used to retrieve the label map.
-