public class DifferenceOfGaussian<A extends Type<A>,B extends NumericType<B> & Comparable<B>> extends Object implements Algorithm, MultiThreaded, Benchmark
Modifier and Type | Class and Description |
---|---|
static class |
DifferenceOfGaussian.SpecialPoint |
Modifier and Type | Field and Description |
---|---|
protected Converter<A,B> |
converter |
protected Image<B> |
dogImage |
protected ImageFactory<B> |
factory |
protected Image<A> |
image |
protected OutOfBoundsStrategyFactory<B> |
outOfBoundsFactory |
protected ArrayList<DifferenceOfGaussianPeak<B>> |
peaks |
Constructor and Description |
---|
DifferenceOfGaussian(Image<A> img,
ImageFactory<B> factory,
Converter<A,B> converter,
OutOfBoundsStrategyFactory<B> outOfBoundsFactory,
double[] sigma1,
double[] sigma2,
B minPeakValue,
B normalizationFactor)
Extracts local minima and maxima of a certain size.
|
DifferenceOfGaussian(Image<A> img,
ImageFactory<B> factory,
Converter<A,B> converter,
OutOfBoundsStrategyFactory<B> outOfBoundsFactory,
double sigma1,
double sigma2,
B minPeakValue,
B normalizationFactor)
Calls the DifferenceOfGaussian constructor with the given sigmas copied into double[] arrays,
one entry per dimension.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkInput() |
ArrayList<DifferenceOfGaussianPeak<B>> |
findPeaks(Image<B> laPlace) |
boolean |
getComputeConvolutionsParalell() |
Image<B> |
getDoGImage() |
String |
getErrorMessage() |
protected OutputAlgorithm<B> |
getGaussianConvolution(double[] sigma,
int nThreads)
This method returns the
OutputAlgorithm that will compute the Gaussian Convolutions, more efficient versions can override this method |
boolean |
getKeepDoGImage() |
B |
getMinPeakValue() |
protected Function<B,B,B> |
getNormalizedSubtraction()
Returns the function that does the normalized subtraction of the gauss images, more efficient versions can override this method
|
int |
getNumThreads()
The number of threads used by the algorithm
|
ArrayList<DifferenceOfGaussianPeak<B>> |
getPeaks() |
long |
getProcessingTime() |
protected boolean |
isPeakHighEnough(B value)
Checks if the absolute value of the current peak is high enough, more efficient versions can override this method
|
protected DifferenceOfGaussian.SpecialPoint |
isSpecialPoint(LocalNeighborhoodCursor<B> neighborhoodCursor,
B centerValue)
Checks if the current position is a minima or maxima in a 3^n neighborhood, more efficient versions can override this method
|
boolean |
process() |
void |
setComputeConvolutionsParalell(boolean paralell) |
void |
setKeepDoGImage(boolean keepDoGImage) |
void |
setMinPeakValue(B value) |
void |
setNumThreads()
Sets the number of threads to the amount of processors available
|
void |
setNumThreads(int numThreads)
Sets the number of threads
|
protected Image<B extends NumericType<B> & Comparable<B>> dogImage
protected final ImageFactory<B extends NumericType<B> & Comparable<B>> factory
protected final OutOfBoundsStrategyFactory<B extends NumericType<B> & Comparable<B>> outOfBoundsFactory
protected final ArrayList<DifferenceOfGaussianPeak<B extends NumericType<B> & Comparable<B>>> peaks
protected final Converter<A extends Type<A>,B extends NumericType<B> & Comparable<B>> converter
public DifferenceOfGaussian(Image<A> img, ImageFactory<B> factory, Converter<A,B> converter, OutOfBoundsStrategyFactory<B> outOfBoundsFactory, double sigma1, double sigma2, B minPeakValue, B normalizationFactor)
public DifferenceOfGaussian(Image<A> img, ImageFactory<B> factory, Converter<A,B> converter, OutOfBoundsStrategyFactory<B> outOfBoundsFactory, double[] sigma1, double[] sigma2, B minPeakValue, B normalizationFactor)
Image
and detects all local minima and maxima in 3x3x3x....3 environment, which is returned
as an ArrayList
of DifferenceOfGaussianPeak
s. The two sigmas define the scale on which
extrema are identified, it correlates with the size of the object.
Note that not only extrema of this size are found, but they will have the higher absolute values. Note as
well that the values of the difference of gaussian image is also defined by the distance between the two
sigmas. A normalization if necessary can be found in the ScaleSpace
class.
Also note a technical detail, the method findPeaks(Image img) can be called on any image if the image
from where the extrema should be computed already exists.img
- - The input Image
factory
- - The ImageFactory
which defines the datatype in which the computation is performedconverter
- - The Converter
which defines how to convert into outOfBoundsFactory
- - The OutOfBoundsStrategyFactory
necessary for the GaussianConvolution
sigma1
- - The lower sigmasigma2
- - The higher sigmaminPeakValue
- -normalizationFactor
- public void setMinPeakValue(B value)
public B getMinPeakValue()
public void setKeepDoGImage(boolean keepDoGImage)
public boolean getKeepDoGImage()
public ArrayList<DifferenceOfGaussianPeak<B>> getPeaks()
public void setComputeConvolutionsParalell(boolean paralell)
public boolean getComputeConvolutionsParalell()
protected OutputAlgorithm<B> getGaussianConvolution(double[] sigma, int nThreads)
OutputAlgorithm
that will compute the Gaussian Convolutions, more efficient versions can override this methodsigma
- - the sigma of the convolutionnThreads
- - the number of threads for this convolutionprotected Function<B,B,B> getNormalizedSubtraction()
protected boolean isPeakHighEnough(B value)
value
- - the current valueprotected DifferenceOfGaussian.SpecialPoint isSpecialPoint(LocalNeighborhoodCursor<B> neighborhoodCursor, B centerValue)
neighborhoodCursor
- - the LocalNeighborhoodCursor
centerValue
- - the value in the center which is testedpublic ArrayList<DifferenceOfGaussianPeak<B>> findPeaks(Image<B> laPlace)
public boolean checkInput()
checkInput
in interface Algorithm
public String getErrorMessage()
getErrorMessage
in interface Algorithm
public long getProcessingTime()
getProcessingTime
in interface Benchmark
public void setNumThreads()
MultiThreaded
setNumThreads
in interface MultiThreaded
public void setNumThreads(int numThreads)
MultiThreaded
setNumThreads
in interface MultiThreaded
numThreads
- - number of threads to usepublic int getNumThreads()
MultiThreaded
getNumThreads
in interface MultiThreaded
Copyright © 2015–2021 Fiji. All rights reserved.