@ALDAOperator(genericExecutionMode=ALL, level=STANDARD, allowBatchMode=false, shortDescription="Detects spotlike structures in 2D based on the undecimated wavelet transform.") @ALDDerivedClass public class ParticleDetectorUWT2D extends ParticleDetector implements loci.common.StatusReporter
The undecimated wavelet transform produces wavelet coefficient images
that correspond to the results of filtering the original image with a
bank of filters. There is one lowpass-filtered image, one
highpass-filtered image and several bandpass filtered images,
depending on the parameter Jmax
. The different
bands/filtered images are referenced by the 'scale'.
The parameters Jmin
and Jmax
determine
the lower and upper scale limit and, thus, control the range of
wavelet images that are taken into account for particle detection.
Scale 1 corresponds to the highpass filtered image and increasing
scales correspond to decreasing frequency bands.
The scaleIntervalSize
parameter determines, how many
wavelet images of adjacent scales are used to compute a wavelet
correlation image, which is the multiplication of wavelet coefficients
over adjacent scales at each pixel.
A short example: Jmin=2, Jmax=4, scaleIntervalSize=2
This means that the bandpass filtered images of scale 2 and 3 are
multiplied for one correlation image, and the bandpass filtered images
of scale 3 and 4 for another.
Correlation images are then thresholded by corrThreshold
to yield hypotheses of particle detections. Because multiple
hypotheses can exist at the same location due to multiple correlation
images, a kind of hypothesis testing is used to determine the more
likely detection at a certain location.
The resulting set of particle detections can be extracted from the particle detector as a set of regions. In addition, in verbose mode the sets of computed original and binary correlation images are also available as image stacks.
The input image may be transformed if it contains Poisson noise to
simulate Gaussian noise using the parameter
poisson2gauss
.
For further details refer to:
Modifier and Type | Class and Description |
---|---|
protected static class |
ParticleDetectorUWT2D.UWTRunner
Thread class to run UWT wavelet transformation threaded.
|
de.unihalle.informatik.Alida.operator.ALDOperatorControllable.OperatorControlStatus, de.unihalle.informatik.Alida.operator.ALDOperatorControllable.OperatorControlStatusHandle, de.unihalle.informatik.Alida.operator.ALDOperatorControllable.OperatorExecutionStatus
Modifier and Type | Field and Description |
---|---|
private boolean |
additionalResultsWanted
Flag to activate calculation of additional result images.
|
private MTBImageByte |
binaryCorrelationImages
Stack of binarized correlation images.
|
private MTBImage |
correlationImages
Stack of correlation images for different scale combinations.
|
private Double |
corrThreshold
Threshold for correlation images.
|
private MTBImageByte |
excludeMask
Optional mask to exclude particles in certain regions.
|
private boolean |
initialSigmaOneHalve
Flag to use initial sigma = 0.5 for the wavelet transform
|
private MTBImage |
inputImage
Input image to process.
|
private Integer |
Jmax
Maximum scale to consider.
|
private Integer |
Jmin
Minimal scale to consider.
|
protected Vector<loci.common.StatusListener> |
m_statusListeners
Vector of installed
StatusListener objects. |
private int |
minRegionSize
Minimal size of valid regions.
|
private static String |
opIdentifier
Identifier for outputs in verbose mode.
|
private boolean |
poisson2gauss
Flag to activate Poisson-to-Gaussian noise transform.
|
private MTBRegion2DSet |
resultingRegions
Set of detected particle regions.
|
private MTBImageByte |
resultMaskBinary
Binary mask of detected regions.
|
private MTBImage |
resultOverlay
Detected regions plotted into input image.
|
private int |
resultRegionCount
Number of detected regions.
|
private Integer |
scaleIntervalSize
Size of scale interval for calculating wavelet correlation images.
|
Constructor and Description |
---|
ParticleDetectorUWT2D()
Constructor.
|
ParticleDetectorUWT2D(MTBImage img,
int _Jmin,
int _Jmax,
double _corrThreshold,
int _scaleIntervalSize,
int _minRegionSize)
Constructor that sets the poisson2gauss flag to
true |
ParticleDetectorUWT2D(MTBImage img,
int _Jmin,
int _Jmax,
double _corrThreshold,
int _scaleIntervalSize,
int _minRegionSize,
boolean _poisson2gauss)
Constructor with non-default parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
addStatusListener(loci.common.StatusListener statuslistener) |
protected MTBImage |
fillHoles(MTBImage img) |
protected static MTBImage |
gauss2poisson(MTBImage img)
Transforms image with gaussian noise to image with poisson noise
J.
|
protected MTBImage[] |
getCorrelationImages()
Compute the correlation images as specified by the parameters.
|
Double |
getCorrelationThreshold()
Get threshold for thresholding wavelet correlation images
|
String |
getDocumentation() |
MTBImage |
getInputImage()
Get input image
|
Integer |
getJmax()
Get Jmax
|
Integer |
getJmin()
Get Jmin
|
protected Integer |
getLabelMostInRegion(MTBRegion2D reg,
MTBImage img) |
protected Vector<Integer> |
getLabelsInRegion(MTBRegion2D reg,
MTBImage img) |
protected MTBImage |
getMaskFromNuclei(MTBImage nucleiImg) |
int |
getMinRegionSize()
Get the minimum size of detected regions.
|
protected MTBImageHistogram |
getNormalizedCumulativeHistogram(MTBImage img,
int bins)
Create a normalized cumulative histogram from an image
|
boolean |
getPoisson2Gauss()
Get flag if input image with poisson noise is to be transformed to image with gaussian noise following
J.
|
protected MTBTree |
getRegionsTree(MTBImage[] binaryImages)
Build a tree of regions from binarized images.
|
MTBImage |
getResultBinaryCorrelationStack()
Get resulting binarized correlation image stack.
|
MTBImage |
getResultCorrelationStack()
Get resulting correlation image stack.
|
MTBRegion2DSet |
getResults()
Get resulting regions (each detetection corresponds to a region)
|
protected double |
getSample(double[] cdf)
Returns a sample in the range [0, 1] from a cumulative distribution given by the array cdf
|
Integer |
getScaleIntervalSize()
Get the size of the scale interval for correlation images
|
protected MTBImage |
inverseATrousDWT(MTBImage[] dwt) |
protected MTBImage |
labelImage(MTBImage img,
MTBRegion2DSet regs) |
protected double |
logPofRegion(MTBRegion2D reg,
MTBImage img,
MTBImageHistogram cumHist) |
protected Vector<MTBTreeNode> |
meaningfulNodes(MTBTreeNode treeNode,
MTBImage[] corrImgs,
MTBImageHistogram[] hists,
int mode)
Get the most meaningful regions from a (sub)tree.
|
protected double |
meanOfRegion(MTBRegion2D reg,
MTBImage img) |
void |
notifyListeners(loci.common.StatusEvent e) |
protected void |
operate() |
static MTBImage |
poisson2gauss(MTBImage img)
Transforms image with poisson noise to image with gaussian noise
J.
|
protected MTBImage |
processedRegionsToBinImage(MTBImage img,
MTBRegion2DSet regs,
int _minRegionSize)
Create a binary image from given regions.
|
protected MTBImage |
regionsToBinImage(MTBImage img,
MTBImage mask,
Vector<MTBRegion2D> regs)
Create binary image from a set of regions.
|
void |
removeStatusListener(loci.common.StatusListener statuslistener) |
void |
setCorrelationThreshold(double corrThresh)
Set threshold for thresholding wavelet correlation images
|
void |
setExcludeMask(MTBImageByte mask)
Specify exclude mask.
|
void |
setInputImage(MTBImage img)
Set input image
|
void |
setJmax(int _Jmax)
Set Jmax
|
void |
setJmin(int _Jmin)
Set Jmin
|
void |
setMinRegionSize(int _minRegionSize)
Set the minimum size of detected regions.
|
void |
setPoisson2Gauss(boolean _poisson2gauss)
Set flag if input image with poisson noise is to be transformed to image with gaussian noise following
J.
|
protected void |
setResults(MTBRegion2DSet detectedRegions)
Set detected regions
|
void |
setScaleIntervalSize(int _scaleIntervalSize)
Set the size of the scale interval for correlation images
|
boolean |
supportsStepWiseExecution() |
protected void |
threshDWTCoeffs(MTBImage img,
double sigma) |
protected void |
threshDWTJeffreys(MTBImage[] dwt,
double scaleOneSigma,
double[] sigmaScales) |
protected MTBImage |
threshImage(MTBImage img,
double thresh) |
protected MTBImage |
threshImgNiblack(MTBImage img,
double k,
int winsize) |
void |
validateCustom() |
addALDConfigurationEventListener, addALDControlEventListener, fireALDConfigurationEvent, fireALDControlEvent, getControlStatus, getControlStatusHandle, getExecutionStatus, handleALDConfigurationEvent, handleALDControlEvent, removeALDConfigurationEventListener, removeALDControlEventListener, setControlStatus, setNotifyRecursiveFlag
addOperatorExecutionProgressEventListener, addParameter, addParameter, addParameterUnconditioned, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getHidingMode, getInactiveParameterNames, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterDescriptorUnconditioned, getParameterNames, getParameterUnconditioned, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, hasInOutParameters, hasParameter, isAnnotatedParameter, isConfigured, print, print, print, printInterface, printInterface, readHistory, readResolve, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, removeParameter, runOp, runOp, runOp, setConstructionMode, setConstructionMode, setConstructionMode, setHidingMode, setName, setParameter, setParameterUnconditioned, setVerbose, toStringVerbose, unconfiguredItems, validate, validateGeneric, writeHistory, writeHistory, writeHistory
private static final String opIdentifier
@Parameter(label="Input image", required=true, direction=IN, mode=STANDARD, dataIOOrder=1, description="Input image.") private transient MTBImage inputImage
@Parameter(label="Jmin", required=true, direction=IN, mode=STANDARD, dataIOOrder=2, description="Minimum scale index.") private Integer Jmin
@Parameter(label="Jmax", required=true, direction=IN, mode=STANDARD, dataIOOrder=3, description="Maximum scale index.") private Integer Jmax
@Parameter(label="Scale-interval size", required=true, direction=IN, mode=STANDARD, dataIOOrder=4, description="Size of scale interval for correlation images.") private Integer scaleIntervalSize
@Parameter(label="Correlation threshold", required=true, direction=IN, mode=STANDARD, dataIOOrder=5, description="Threshold for wavelet correlation images.") private Double corrThreshold
@Parameter(label="Minimum region size", required=true, direction=IN, mode=STANDARD, dataIOOrder=6, description="Minimum area of detected regions.") private int minRegionSize
@Parameter(label="Apply Poisson-to-Gaussian noise transform", required=true, direction=IN, mode=ADVANCED, dataIOOrder=7, description="Transform input image with poisson noise to image with Gaussian noise (J.-L. Starck et al).") private boolean poisson2gauss
@Parameter(label="use initial sigma = 0.5 for the wavelet transform", required=true, direction=IN, mode=ADVANCED, dataIOOrder=8, description="use initial sigma = 0.5 for the wavelet transform") private boolean initialSigmaOneHalve
@Parameter(label="Exclude mask", direction=IN, mode=ADVANCED, dataIOOrder=9, required=false, description="Exclude mask.") private transient MTBImageByte excludeMask
Particles in masked regions are ignored if mask is non-null.
@Parameter(label="Provide (binarized) correlation images", supplemental=true, direction=IN, mode=ADVANCED, dataIOOrder=10, description="If enabled additional intermediate results are provided.") private boolean additionalResultsWanted
@Parameter(label="#Regions", direction=OUT, mode=STANDARD, dataIOOrder=1, description="Number of detected regions.") private transient int resultRegionCount
@Parameter(label="Resulting particle regions", direction=OUT, mode=STANDARD, dataIOOrder=2, description="Detected particle regions.") private transient MTBRegion2DSet resultingRegions
@Parameter(label="Resulting particle regions", direction=OUT, mode=STANDARD, dataIOOrder=3, description="Overlay of regions onto input image.") private transient MTBImage resultOverlay
@Parameter(label="Binary particle region mask", direction=OUT, mode=STANDARD, dataIOOrder=4, description="Binary particle region mask.") private transient MTBImageByte resultMaskBinary
@Parameter(label="Correlation images", direction=OUT, mode=STANDARD, dataIOOrder=1, supplemental=true, description="Correlation images for different scale intervals.") private transient MTBImage correlationImages
This stack is only generated if additionalResultsWanted
is selected.
@Parameter(label="Binarized correlation images", direction=OUT, mode=STANDARD, dataIOOrder=2, supplemental=true, description="Binarized correlation images.") private transient MTBImageByte binaryCorrelationImages
This stack is only generated if additionalResultsWanted
is selected.
protected Vector<loci.common.StatusListener> m_statusListeners
StatusListener
objects.public ParticleDetectorUWT2D() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public ParticleDetectorUWT2D(MTBImage img, int _Jmin, int _Jmax, double _corrThreshold, int _scaleIntervalSize, int _minRegionSize, boolean _poisson2gauss) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
img
- input image with bright granules on dark background_Jmin
- lowest scale index to be used for correlation image computations (scale is reciprocal to frequency properties)_Jmax
- highest scale index to be used for correlation image computations (scale is reciprocal to frequency properties)_corrThreshold
- threshold for wavelet correlation images to obtain detected region hypotheses_scaleIntervalSize
- size of the interval of scales that are used to compute wavelet correlation images_minRegionSize
- minimum size of a region to be chosen as detection_poisson2gauss
- flag if image with poisson noise is transformed to simulate gaussian noisede.unihalle.informatik.Alida.exceptions.ALDOperatorException
public ParticleDetectorUWT2D(MTBImage img, int _Jmin, int _Jmax, double _corrThreshold, int _scaleIntervalSize, int _minRegionSize) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
true
img
- input image with bright granules on dark backgroundJmin
- lowest scale index to be used for correlation image computations (scale is reciprocal to frequency properties)Jmax
- highest scale index to be used for correlation image computations (scale is reciprocal to frequency properties)corrThreshold
- threshold for wavelet correlation images to obtain detected region hypothesesscaleIntervalSize
- size of the interval of scales that are used to compute wavelet correlation imagesminRegionSize
- minimum size of a region to be chosen as detectionde.unihalle.informatik.Alida.exceptions.ALDOperatorException
public void validateCustom() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
validateCustom
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public boolean supportsStepWiseExecution()
supportsStepWiseExecution
in class de.unihalle.informatik.Alida.operator.ALDOperatorControllable
protected void operate() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
operate
in class ParticleDetector
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected Vector<MTBTreeNode> meaningfulNodes(MTBTreeNode treeNode, MTBImage[] corrImgs, MTBImageHistogram[] hists, int mode)
treeNode
- root of the (sub) treecorrImgs
- correlation imageshists
- cumulative histogramsmode
- 0: weighted mean, 1: unweighted mean, 2: min, 3 or else: maxprotected MTBTree getRegionsTree(MTBImage[] binaryImages) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
binaryImages
- de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected MTBImage[] getCorrelationImages() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public static MTBImage poisson2gauss(MTBImage img) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
protected static MTBImage gauss2poisson(MTBImage img) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
protected MTBImageHistogram getNormalizedCumulativeHistogram(MTBImage img, int bins)
img
- input imagebins
- number of histogram binsprotected MTBImage fillHoles(MTBImage img) throws IllegalArgumentException, de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
IllegalArgumentException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected MTBImage threshImgNiblack(MTBImage img, double k, int winsize) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected MTBImage getMaskFromNuclei(MTBImage nucleiImg) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected Integer getLabelMostInRegion(MTBRegion2D reg, MTBImage img)
protected Vector<Integer> getLabelsInRegion(MTBRegion2D reg, MTBImage img)
protected double meanOfRegion(MTBRegion2D reg, MTBImage img)
protected double logPofRegion(MTBRegion2D reg, MTBImage img, MTBImageHistogram cumHist)
protected MTBImage threshImage(MTBImage img, double thresh) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected MTBImage labelImage(MTBImage img, MTBRegion2DSet regs)
protected MTBImage regionsToBinImage(MTBImage img, MTBImage mask, Vector<MTBRegion2D> regs)
img
- only used to determine the result image sizemask
- regs
- protected MTBImage processedRegionsToBinImage(MTBImage img, MTBRegion2DSet regs, int _minRegionSize)
Regions smaller than _minRegionSize
are rejected.
img
- Input image.regs
- Region set._minRegionSize
- Minimal size of regions considered.protected void threshDWTJeffreys(MTBImage[] dwt, double scaleOneSigma, double[] sigmaScales)
protected MTBImage inverseATrousDWT(MTBImage[] dwt) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
protected void threshDWTCoeffs(MTBImage img, double sigma)
protected double getSample(double[] cdf)
cdf
- cumulative distribution arraypublic void addStatusListener(loci.common.StatusListener statuslistener)
addStatusListener
in interface loci.common.StatusReporter
public void notifyListeners(loci.common.StatusEvent e)
notifyListeners
in interface loci.common.StatusReporter
public void removeStatusListener(loci.common.StatusListener statuslistener)
removeStatusListener
in interface loci.common.StatusReporter
public MTBImage getInputImage()
public void setInputImage(MTBImage img)
public Integer getJmin()
public void setJmin(int _Jmin)
public Integer getJmax()
public void setJmax(int _Jmax)
public Double getCorrelationThreshold()
public void setCorrelationThreshold(double corrThresh)
public Integer getScaleIntervalSize()
public void setScaleIntervalSize(int _scaleIntervalSize)
public int getMinRegionSize()
public void setMinRegionSize(int _minRegionSize)
public boolean getPoisson2Gauss()
public void setPoisson2Gauss(boolean _poisson2gauss)
public void setExcludeMask(MTBImageByte mask)
public MTBRegion2DSet getResults()
protected void setResults(MTBRegion2DSet detectedRegions)
public MTBImage getResultCorrelationStack()
Note that additionalResultsWanted
needs to be selected to
get a non-null result here.
public MTBImage getResultBinaryCorrelationStack()
Note that additionalResultsWanted
needs to be selected to
get a non-null result here.
public String getDocumentation()
getDocumentation
in class de.unihalle.informatik.Alida.operator.ALDOperator
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.