T
- element type of inputB
- element type of maskpublic class WatershedSeeded<T extends RealType<T>,B extends BooleanType<B>> extends AbstractUnaryHybridCF<RandomAccessibleInterval<T>,ImgLabeling<Integer,IntType>> implements Ops.Image.Watershed, Contingent
Beucher, Serge, and Fernand Meyer. "The morphological approach to segmentation: the watershed transformation." Optical Engineering-New York-Marcel Dekker Incorporated- 34 (1992): 433-433.
Input is a grayscale image with arbitrary number of dimensions, defining the heightmap, and labeling image defining where the seeds, i.e. the minima are. 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. 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.
SpecialOp.Flavor
NAME
Constructor and Description |
---|
WatershedSeeded() |
Modifier and Type | Method and Description |
---|---|
void |
compute(RandomAccessibleInterval<T> in,
ImgLabeling<Integer,IntType> out)
Computes the output given some input.
|
boolean |
conforms()
True if the contingency holds; i.e., the current circumstances conform to
the contingency's requirements.
|
ImgLabeling<Integer,IntType> |
createOutput(RandomAccessibleInterval<T> in)
Create an output object given some input.
|
void |
initialize()
Initializes the object.
|
in, out, setInput, setOutput
ops, setEnvironment
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
ops, setEnvironment
calculate, calculate, createOutput, getIndependentInstance, run, run
compute
in, setInput
run
setOutput
candidates, filterArity, op
public void compute(RandomAccessibleInterval<T> in, ImgLabeling<Integer,IntType> out)
UnaryComputerOp
compute
in interface UnaryComputerOp<RandomAccessibleInterval<T extends RealType<T>>,ImgLabeling<Integer,IntType>>
in
- Argument to the computation, which must be non-nullout
- Object where the computation's result will be stored, which
must be non-null and a different object than input
public boolean conforms()
Contingent
conforms
in interface Contingent
public ImgLabeling<Integer,IntType> createOutput(RandomAccessibleInterval<T> in)
UnaryOutputFactory
createOutput
in interface UnaryOutputFactory<RandomAccessibleInterval<T extends RealType<T>>,ImgLabeling<Integer,IntType>>
in
- which determines how to create the outputpublic void initialize()
Initializable
initialize
in interface Initializable
Copyright © 2014–2022 ImageJ. All rights reserved.