public class Watershed<T extends RealType<T>,L extends Comparable<L>> extends Object implements OutputAlgorithm<Labeling<L>>
Modifier and Type | Class and Description |
---|---|
protected static class |
Watershed.PixelIntensity<U extends Comparable<U>> |
Modifier and Type | Field and Description |
---|---|
protected RandomAccessibleInterval<T> |
image |
protected Labeling<L> |
output |
protected Labeling<L> |
seeds |
Constructor and Description |
---|
Watershed() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkInput() |
String |
getErrorMessage() |
Labeling<L> |
getResult() |
boolean |
process()
The seeded watershed uses a pre-existing labeling of the space where the
labels act as seeds for the output watershed.
|
void |
setIntensityImage(RandomAccessibleInterval<T> image)
Provide the intensity image to be watershedded.
|
void |
setOutputLabeling(Labeling<L> outputLabeling)
Set the output labeling where the results will be stored.
|
void |
setSeeds(Labeling<L> seeds)
Provide the seeds that mark the watersheds.
|
void |
setStructuringElement(long[][] structuringElement)
Set the structuring element that defines the connectivity
|
protected RandomAccessibleInterval<T extends RealType<T>> image
protected Labeling<L extends Comparable<L>> seeds
protected Labeling<L extends Comparable<L>> output
public void setIntensityImage(RandomAccessibleInterval<T> image)
image
- the intensity image that defines the watershed landscape.
Lower values will be labeled first.public void setSeeds(Labeling<L> seeds)
seeds
- a labeling of the space, defining the first pixels in the
space to be labeled. The seeded pixels will be similarly
labeled in the output as will be their watershed neighbors.public void setStructuringElement(long[][] structuringElement)
structuringElement
- an array of offsets where each element of the array gives the
offset of a connected pixel from a pixel of interest. You can
use AllConnectedComponents.getStructuringElement to get an
8-connected (or N-dimensional equivalent) structuring element
(all adjacent pixels + diagonals).public void setOutputLabeling(Labeling<L> outputLabeling)
outputLabeling
- public boolean process()
public boolean checkInput()
checkInput
in interface Algorithm
public String getErrorMessage()
getErrorMessage
in interface Algorithm
public Labeling<L> getResult()
getResult
in interface OutputAlgorithm<Labeling<L extends Comparable<L>>>
Copyright © 2015–2022 ImgLib2. All rights reserved.