T
- The type of the image.L
- The type of the labeling, typically Integerpublic class GradientWatershed<T extends RealType<T>,L extends Comparable<L>> extends Object implements OutputAlgorithm<LabelingType<L>>
Modifier and Type | Field and Description |
---|---|
protected String |
error_message |
protected ImageFactory<FloatType> |
floatFactory |
protected Image<FloatType> |
floatImage |
protected Image<T> |
input |
protected ImageFactory<LabelingType<L>> |
labelingFactory |
protected double |
minBackgroundPeakHeight |
protected double |
minForegroundPeakHeight |
protected Iterator<L> |
names |
protected int |
numQuanta |
protected Labeling<L> |
output |
protected double[] |
scale |
protected double[] |
sigma1 |
protected double[] |
sigma2 |
protected int[][] |
structuringElement |
protected boolean |
wantsToQuantize |
Constructor and Description |
---|
GradientWatershed(Image<T> input,
double[] scale,
double[] sigma1,
double[] sigma2,
Iterator<L> names)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkDimensions(double[] array) |
protected boolean |
checkDimensions(int[] array) |
boolean |
checkInput() |
protected static int[][] |
cloneStructuringElement(int[][] structuringElement) |
void |
enableQuantization(boolean enable)
The watershed repetitively evaluates the lowest intensity unlabeled pixel
starting from the seeds.
|
protected boolean |
filterPeak(LocalizableByDimCursor<FloatType> imageCursor,
int[] peak,
int[] dimensions,
boolean find_minimum) |
String |
getErrorMessage() |
protected ImageFactory<FloatType> |
getFloatFactory() |
protected Image<FloatType> |
getFloatImage() |
Image<FloatType> |
getGradientImage()
Return a difference of gaussian image that measures the gradient
at a scale defined by the two sigmas of the gaussians.
|
double |
getMinBackgroundPeakHeight()
See setMinBackgroundPeakHeight
|
double |
getMinForegroundPeakHeight()
See setMinForegroundPeakHeight
|
int |
getNumQuanta()
See setNumQuanta
|
ImageFactory<LabelingType<L>> |
getOutputImageFactory() |
Image<LabelingType<L>> |
getResult() |
double[] |
getScale()
Return the scale of the objects to be found.
|
int[][] |
getStructuringElement()
Get the current structuring element.
|
boolean |
isQuantized()
see enableQuantization
|
boolean |
process() |
void |
setMinBackgroundPeakHeight(double height)
The algorithm finds both foreground (local maxima) and
background peaks (local minima) to act as seeds for the watershed.
|
void |
setMinForegroundPeakHeight(double height)
The algorithm finds both foreground (local maxima) and
background peaks (local minima) to act as seeds for the watershed.
|
void |
setNumQuanta(int numQuanta)
See enableQuantization
You must enableQuantization as well as set the number of quanta.
|
void |
setOutputImageFactory(ImageFactory<LabelingType<L>> factory)
Set the image factory to use when creating the Labeling.
|
void |
setOutputLabeling(Labeling<L> labeling)
Supply a labeling that will be filled with labelings by the image.
|
void |
setScale(double[] scale)
Set the scale of the objects to be found.
|
void |
setStructuringElement(int[][] structuringElement)
Set the current structuring element.
|
protected Labeling<L extends Comparable<L>> output
protected double[] scale
protected double[] sigma1
protected double[] sigma2
protected Iterator<L extends Comparable<L>> names
protected double minBackgroundPeakHeight
protected double minForegroundPeakHeight
protected boolean wantsToQuantize
protected int numQuanta
protected int[][] structuringElement
protected String error_message
protected ImageFactory<LabelingType<L extends Comparable<L>>> labelingFactory
protected ImageFactory<FloatType> floatFactory
public GradientWatershed(Image<T> input, double[] scale, double[] sigma1, double[] sigma2, Iterator<L> names)
image
- The intensity image to be labeledscale
- the minimum distance between maxima of objects. Less
technically, this should be the diameter of the smallest object.sigma1
- the standard deviation for the larger smoothing. The
difference between sigma1 and sigma2 should be roughly the width
of the desired edge in the DoG image. A larger difference will obscure
small, faint edges.sigma2
- the standard deviation for the smaller smoothing. This
should be on the order of the largest insignificant feature in the image.names
- - an iterator that generates names of type L for the labels.
The iterator will waste the last name taken on the background label.
You can use AllConnectedComponents.getIntegerNames() as your name
generator if you don't care about names.public int[][] getStructuringElement()
protected static int[][] cloneStructuringElement(int[][] structuringElement)
public void setStructuringElement(int[][] structuringElement)
AllConnectedComponents.getStructuringElement
for a
discussion of the structuring element format. The structuring element
determines which pixels are considered neighbors of a newly-added
pixel in the watershed algorithm.
By default, an 8-connected (neighbors + diagonals) or its N-dimensional
analog structuring element is used.structuringElement
- - the new structuring element.public double[] getScale()
public void setScale(double[] scale)
scale
- public void setMinBackgroundPeakHeight(double height)
height
- - the minimum intensity difference between the peak
and the highest intensity pixel in its neighborhoodpublic double getMinBackgroundPeakHeight()
public void setMinForegroundPeakHeight(double height)
height
- - the minimum intensity difference between the peak
and the lowest intensity pixel in its neighborhoodpublic double getMinForegroundPeakHeight()
public void enableQuantization(boolean enable)
enable
- - true to enable quantization, false to disable.public boolean isQuantized()
public void setNumQuanta(int numQuanta)
numQuanta
- - the number of quanta in the quantizationpublic void setOutputImageFactory(ImageFactory<LabelingType<L>> factory)
factory
- - a customized factory for generating the labeling
containers.public ImageFactory<LabelingType<L>> getOutputImageFactory()
public void setOutputLabeling(Labeling<L> labeling)
labeling
- - a labeling container that will hold the labeling
of the image after process() is called.public int getNumQuanta()
public boolean checkInput()
checkInput
in interface Algorithm
protected boolean checkDimensions(int[] array)
protected boolean checkDimensions(double[] array)
protected ImageFactory<FloatType> getFloatFactory()
public String getErrorMessage()
getErrorMessage
in interface Algorithm
public Image<LabelingType<L>> getResult()
getResult
in interface OutputAlgorithm<LabelingType<L extends Comparable<L>>>
protected boolean filterPeak(LocalizableByDimCursor<FloatType> imageCursor, int[] peak, int[] dimensions, boolean find_minimum)
Copyright © 2015–2021 Fiji. All rights reserved.