de.unihalle.informatik.MiToBo.apps.particles2D
Class ParticleDetectorUWT2D

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDOperator
      extended by de.unihalle.informatik.Alida.operator.ALDOperatorControllable
          extended by de.unihalle.informatik.MiToBo.core.operator.MTBOperatorControllable
              extended by de.unihalle.informatik.MiToBo.apps.particles2D.ParticleDetector
                  extended by de.unihalle.informatik.MiToBo.apps.particles2D.ParticleDetectorUWT2D
All Implemented Interfaces:
de.unihalle.informatik.Alida.datatypes.ALDConfigurationValidator, de.unihalle.informatik.Alida.operator.events.ALDConfigurationEventListener, de.unihalle.informatik.Alida.operator.events.ALDConfigurationEventReporter, de.unihalle.informatik.Alida.operator.events.ALDControlEventListener, de.unihalle.informatik.Alida.operator.events.ALDControlEventReporter, de.unihalle.informatik.Alida.operator.events.ALDOperatorExecutionProgressEventListener, EventListener, loci.common.StatusReporter

@ALDAOperator(genericExecutionMode=ALL,
              level=STANDARD,
              allowBatchMode=false)
@ALDDerivedClass
public class ParticleDetectorUWT2D
extends ParticleDetector
implements loci.common.StatusReporter

Detector for spotlike structures (bright on dark background) in 2D based on the undecimated wavelet transform.

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:

Author:
Oliver Gress

Nested Class Summary
protected  class ParticleDetectorUWT2D.UWTRunner
          Thread class to run UWT wavelet transformation threaded.
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperatorControllable
de.unihalle.informatik.Alida.operator.ALDOperatorControllable.OperatorControlStatus, de.unihalle.informatik.Alida.operator.ALDOperatorControllable.OperatorExecutionStatus
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode
 
Field Summary
protected  Vector<loci.common.StatusListener> m_statusListeners
          Vector of installed StatusListener objects.
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperatorControllable
configurationEventlistenerList, controlEventlistenerList, notifyListenersRecursively, operatorExecStatus, operatorStatus, stepSize, stepWiseExecution
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, operatorExecutionEventlistenerList, portHashAccess, verbose, versionProvider
 
Constructor Summary
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.
 
Method Summary
 void addStatusListener(loci.common.StatusListener statuslistener)
           
protected  MTBImage fillHoles(MTBImage img)
           
protected  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
 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.
 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()
           
protected  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()
           
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperatorControllable
addALDConfigurationEventListener, addALDControlEventListener, fireALDConfigurationEvent, fireALDControlEvent, getExecutionStatus, handleALDConfigurationEvent, handleALDControlEvent, removeALDConfigurationEventListener, removeALDControlEventListener, setNotifyRecursiveFlag
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
addOperatorExecutionProgressEventListener, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getHidingMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, isConfigured, print, print, print, printInterface, printInterface, readHistory, readResolve, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, runOp, runOp, runOp, setConstructionMode, setHidingMode, setName, setParameter, setVerbose, toStringVerbose, unconfiguredItems, validate, validateGeneric, writeHistory, writeHistory, writeHistory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_statusListeners

protected Vector<loci.common.StatusListener> m_statusListeners
Vector of installed StatusListener objects.

Constructor Detail

ParticleDetectorUWT2D

public ParticleDetectorUWT2D()
                      throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Constructor.

Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

ParticleDetectorUWT2D

public ParticleDetectorUWT2D(MTBImage img,
                             int _Jmin,
                             int _Jmax,
                             double _corrThreshold,
                             int _scaleIntervalSize,
                             int _minRegionSize,
                             boolean _poisson2gauss)
                      throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Constructor with non-default parameters.

Parameters:
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 noise
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

ParticleDetectorUWT2D

public ParticleDetectorUWT2D(MTBImage img,
                             int _Jmin,
                             int _Jmax,
                             double _corrThreshold,
                             int _scaleIntervalSize,
                             int _minRegionSize)
                      throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Constructor that sets the poisson2gauss flag to true

Parameters:
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
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail

validateCustom

public void validateCustom()
                    throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Overrides:
validateCustom in class de.unihalle.informatik.Alida.operator.ALDOperator
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

supportsStepWiseExecution

public boolean supportsStepWiseExecution()
Specified by:
supportsStepWiseExecution in class de.unihalle.informatik.Alida.operator.ALDOperatorControllable

operate

protected void operate()
                throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                       de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Specified by:
operate in class ParticleDetector
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

meaningfulNodes

protected Vector<MTBTreeNode> meaningfulNodes(MTBTreeNode treeNode,
                                              MTBImage[] corrImgs,
                                              MTBImageHistogram[] hists,
                                              int mode)
Get the most meaningful regions from a (sub)tree. The tree of regions is assumed to contain different detections from different scales in the same image location. Detections are the regions which "explain" best this image part, the most meaningful regions.

Parameters:
treeNode - root of the (sub) tree
corrImgs - correlation images
hists - cumulative histograms
mode - 0: weighted mean, 1: unweighted mean, 2: min, 3 or else: max
Returns:

getRegionsTree

protected MTBTree getRegionsTree(MTBImage[] binaryImages)
                          throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                                 de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Build a tree of regions from binarized images. The binary images represent regions from different scales, fine scales have low indices in the array

Parameters:
binaryImages -
Returns:
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

getCorrelationImages

protected MTBImage[] getCorrelationImages()
                                   throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                                          de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Compute the correlation images as specified by the parameters.

Returns:
Array of correlation images starting with lowest scale interval which corresponds to the highest frequency interval.
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

poisson2gauss

protected MTBImage poisson2gauss(MTBImage img)
                          throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Transforms image with poisson noise to image with gaussian noise J.-L. Starck et al., Multiresolution Support Applied to Image Filtering and Restoration

Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

gauss2poisson

protected MTBImage gauss2poisson(MTBImage img)
                          throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Transforms image with gaussian noise to image with poisson noise J.-L. Starck et al., Multiresolution Support Applied to Image Filtering and Restoration

Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

getNormalizedCumulativeHistogram

protected MTBImageHistogram getNormalizedCumulativeHistogram(MTBImage img,
                                                             int bins)
Create a normalized cumulative histogram from an image

Parameters:
img - input image
bins - number of histogram bins
Returns:
normalized cumulative histogram

fillHoles

protected MTBImage fillHoles(MTBImage img)
                      throws IllegalArgumentException,
                             de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                             de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Throws:
IllegalArgumentException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

threshImgNiblack

protected MTBImage threshImgNiblack(MTBImage img,
                                    double k,
                                    int winsize)
                             throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                                    de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

getMaskFromNuclei

protected MTBImage getMaskFromNuclei(MTBImage nucleiImg)
                              throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                                     de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

getLabelMostInRegion

protected Integer getLabelMostInRegion(MTBRegion2D reg,
                                       MTBImage img)

getLabelsInRegion

protected Vector<Integer> getLabelsInRegion(MTBRegion2D reg,
                                            MTBImage img)

meanOfRegion

protected double meanOfRegion(MTBRegion2D reg,
                              MTBImage img)

logPofRegion

protected double logPofRegion(MTBRegion2D reg,
                              MTBImage img,
                              MTBImageHistogram cumHist)

threshImage

protected MTBImage threshImage(MTBImage img,
                               double thresh)
                        throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                               de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

labelImage

protected MTBImage labelImage(MTBImage img,
                              MTBRegion2DSet regs)

regionsToBinImage

protected MTBImage regionsToBinImage(MTBImage img,
                                     MTBImage mask,
                                     Vector<MTBRegion2D> regs)
Create binary image from a set of regions. If mask != null, pixels where mask is 0 are not considered.

Parameters:
img - only used to determine the result image size
mask -
regs -
Returns:

processedRegionsToBinImage

protected MTBImage processedRegionsToBinImage(MTBImage img,
                                              MTBRegion2DSet regs,
                                              int _minRegionSize)
Create a binary image from given regions.

Regions smaller than _minRegionSize are rejected.

Parameters:
img - Input image.
regs - Region set.
_minRegionSize - Minimal size of regions considered.
Returns:
Binary image with regions.

threshDWTJeffreys

protected void threshDWTJeffreys(MTBImage[] dwt,
                                 double scaleOneSigma,
                                 double[] sigmaScales)

inverseATrousDWT

protected MTBImage inverseATrousDWT(MTBImage[] dwt)
                             throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

threshDWTCoeffs

protected void threshDWTCoeffs(MTBImage img,
                               double sigma)

getSample

protected double getSample(double[] cdf)
Returns a sample in the range [0, 1] from a cumulative distribution given by the array cdf

Parameters:
cdf - cumulative distribution array
Returns:

addStatusListener

public void addStatusListener(loci.common.StatusListener statuslistener)
Specified by:
addStatusListener in interface loci.common.StatusReporter

notifyListeners

public void notifyListeners(loci.common.StatusEvent e)
Specified by:
notifyListeners in interface loci.common.StatusReporter

removeStatusListener

public void removeStatusListener(loci.common.StatusListener statuslistener)
Specified by:
removeStatusListener in interface loci.common.StatusReporter

getInputImage

public MTBImage getInputImage()
Get input image


setInputImage

public void setInputImage(MTBImage img)
Set input image


getJmin

public Integer getJmin()
Get Jmin


setJmin

public void setJmin(int _Jmin)
Set Jmin


getJmax

public Integer getJmax()
Get Jmax


setJmax

public void setJmax(int _Jmax)
Set Jmax


getCorrelationThreshold

public Double getCorrelationThreshold()
Get threshold for thresholding wavelet correlation images


setCorrelationThreshold

public void setCorrelationThreshold(double corrThresh)
Set threshold for thresholding wavelet correlation images


getScaleIntervalSize

public Integer getScaleIntervalSize()
Get the size of the scale interval for correlation images


setScaleIntervalSize

public void setScaleIntervalSize(int _scaleIntervalSize)
Set the size of the scale interval for correlation images


getMinRegionSize

public int getMinRegionSize()
Get the minimum size of detected regions. All regions smaller than this size are rejected


setMinRegionSize

public void setMinRegionSize(int _minRegionSize)
Set the minimum size of detected regions. All regions smaller than this size are rejected


getPoisson2Gauss

public boolean getPoisson2Gauss()
Get flag if input image with poisson noise is to be transformed to image with gaussian noise following J.-L. Starck et al., Multiresolution Support Applied to Image Filtering and Restoration


setPoisson2Gauss

public void setPoisson2Gauss(boolean _poisson2gauss)
Set flag if input image with poisson noise is to be transformed to image with gaussian noise following J.-L. Starck et al., Multiresolution Support Applied to Image Filtering and Restoration


setExcludeMask

public void setExcludeMask(MTBImageByte mask)
Specify exclude mask.


getResults

public MTBRegion2DSet getResults()
Get resulting regions (each detetection corresponds to a region)


setResults

protected void setResults(MTBRegion2DSet detectedRegions)
Set detected regions



Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.