Class WatershedBinary<T extends BooleanType<T>,B extends BooleanType<B>>
- java.lang.Object
-
- org.scijava.ops.image.image.watershed.WatershedBinary<T,B>
-
- Type Parameters:
T- element type of inputB- element type of mask
- All Implemented Interfaces:
Computers.Arity5<RandomAccessibleInterval<T>,Boolean,Boolean,double[],RandomAccessibleInterval<B>,ImgLabeling<Integer,IntType>>,Consumers.Arity6<RandomAccessibleInterval<T>,Boolean,Boolean,double[],RandomAccessibleInterval<B>,ImgLabeling<Integer,IntType>>
public class WatershedBinary<T extends BooleanType<T>,B extends BooleanType<B>> extends Object implements Computers.Arity5<RandomAccessibleInterval<T>,Boolean,Boolean,double[],RandomAccessibleInterval<B>,ImgLabeling<Integer,IntType>>
The Watershed algorithm segments and labels a grayscale image analogous to a heightmap. In short, a drop of water following the gradient of an image flows along a path to finally reach a local minimum.
Lee Vincent, Pierre Soille, Watersheds in digital spaces: An efficient algorithm based on immersion simulations, IEEE Trans. Pattern Anal. Machine Intell., 13(6) 583-598 (1991)
Input is a binary image with arbitrary number of dimensions. The heightmap is calculated by an inverse distance transform, which can optionally be smoothed with an gaussian filter with parameter sigma to prevent having many small segments in the result. Sigma must have the same dimension as the input image. It needs to be defined whether a neighborhood with eight- or four-connectivity (respective to 2D) is used. A binary image can be set as mask which defines the area where computation shall be done. It may make sense to use the input as mask as well. If desired, the watersheds are drawn and labeled as 0. Otherwise the watersheds will be labeled as one of their neighbors.
Output is a labeling of the different catchment basins.
- Author:
- Simon Schmid (University of Konstanz)
- Implementation Note:
- op names='image.watershed'
-
-
Constructor Summary
Constructors Constructor Description WatershedBinary()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompute(RandomAccessibleInterval<T> in, Boolean useEightConnectivity, Boolean drawWatersheds, double[] sigma, RandomAccessibleInterval<B> mask, ImgLabeling<Integer,IntType> out)TODO-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.scijava.function.Computers.Arity5
accept
-
Methods inherited from interface org.scijava.function.Consumers.Arity6
andThen
-
-
-
-
Method Detail
-
compute
public void compute(RandomAccessibleInterval<T> in, Boolean useEightConnectivity, Boolean drawWatersheds, double[] sigma, RandomAccessibleInterval<B> mask, ImgLabeling<Integer,IntType> out)
TODO- Specified by:
computein interfaceComputers.Arity5<RandomAccessibleInterval<T extends BooleanType<T>>,Boolean,Boolean,double[],RandomAccessibleInterval<B extends BooleanType<B>>,ImgLabeling<Integer,IntType>>- Parameters:
in-useEightConnectivity-drawWatersheds-sigma-mask-out-
-
-