de.unihalle.informatik.MiToBo.transforms
Class UndecimatedWaveletTransform

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.transforms.UndecimatedWaveletTransform
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=NONE)
public class UndecimatedWaveletTransform
extends MTBOperatorControllable
implements loci.common.StatusReporter

Undecimated wavelet transform (UWT) operator.

Author:
gress

Nested Class Summary
protected static class UndecimatedWaveletTransform.TransformationMode
           
 
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
 
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
UndecimatedWaveletTransform()
          Constructor with default Gaussian kernel [1/16, 1/4, 3/8, 1/4, 1/16] for dimension x, y and z.
UndecimatedWaveletTransform(MTBImage _img, int _Jmax, boolean _denoise)
          Constructor with default Gaussian kernel [1/16, 1/4, 3/8, 1/4, 1/16] for at most dimension x, y (and z if present).
UndecimatedWaveletTransform(MTBImage _img, int _Jmax, boolean _denoise, MTBImage[] _kernels)
          Constructor.
 
Method Summary
 void addStatusListener(loci.common.StatusListener statuslistener)
           
protected  MTBImage[] aTrousDWT(MTBImage _img, int _Jmax, MTBImage[] _kernels)
          A trous DWT
protected  double[] computeSigmaScales()
          Compute scaling factors of noise sigma for wavelet scales (these scaling factors are estimated using a gaussian noise image with sigma=1 to measure noise in the wavelet scales)
protected  MTBImage conv(MTBImage img, MTBImage[] scaleOneKernels, int j)
          Convolve input image with an 'a trous' kernel (zeros inserted) given the original kernel and scale j
protected  MTBImage createGaussianNoiseImage(double mean, double sigma, double clippingFactor, int bins, int sizeX, int sizeY, int sizeZ, int sizeT, int sizeC)
          Create an image with Gaussian noise
protected  void denoise(MTBImage img, double sigma)
          Denoise wavelet coefficients using Jeffrey's noninformative prior for a given sigma of noise
protected  void denoiseDWTJeffreys(MTBImage[] dwt, double scaleOneSigma, double[] sigmaScales)
          Denoise wavelet coefficients using Jeffrey's noninformative prior [..]
protected  double get3SigClippedStdDev(MTBImage img)
          Get the standard deviation (sigma) of an image only using values clipped by 3*sigma from a first estimate of sigma
 boolean getDenoise()
          Get the denoising flag. true if denoising is activated.
 MTBImage getImg()
          Get reference to the (input) image.
 int getJmax()
          Get Jmax (maximum scale 2^Jmax - 1)
protected  MTBImage[] getKernels()
          Get smoothing kernels
protected  double getSample(double[] cdf)
          Returns a sample in the range [0, 1] from a cumulative distribution given by the array cdf
protected  double getStdDev(MTBImage img)
          Get standard deviation of the image
 MTBImageSet getUWT()
          Get the UWT coefficient images.
protected  MTBImage inverseATrousDWT(MTBImage[] dwt)
          Inverse a trous DWT
 boolean isForwardTransform()
          Test if parameter object is set to (forward) transform (image to wavelet)
 boolean isInverseTransform()
          Test if parameter object is set to Inverse Transform (wavelet to image)
 void notifyListeners(loci.common.StatusEvent e)
           
protected  void operate()
           
 void removeStatusListener(loci.common.StatusListener statuslistener)
           
protected  void setDenoise(boolean denoise)
          Set the denoising flag. true to activate denoising.
 void setForwardTransform()
          Toggle computation of the (forward) transform (image to wavelet)
 void setImg(MTBImage img)
          Set the image domain image
 void setInverseTransform()
          Set computation of the inverse transform (wavelet to image)
protected  void setJmax(int Jmax)
          Set Jmax (maximum scale 2^Jmax - 1)
protected  void setKernels(MTBImage[] kernels)
          Set smoothing kernels
 void setUWT(MTBImageSet uwtImages)
          Set UWT coefficient images
 boolean supportsStepWiseExecution()
           
 
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, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UndecimatedWaveletTransform

public UndecimatedWaveletTransform()
                            throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Constructor with default Gaussian kernel [1/16, 1/4, 3/8, 1/4, 1/16] for dimension x, y and z.

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

UndecimatedWaveletTransform

public UndecimatedWaveletTransform(MTBImage _img,
                                   int _Jmax,
                                   boolean _denoise,
                                   MTBImage[] _kernels)
                            throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Constructor. Separable lowpass kernels are expected (i.e. Gaussian).

Parameters:
_img - input image
_Jmax - maximum scale (2^Jmax - 1)
_denoise - reduction of gaussian noise
_kernels - an array of kernels, which are inflated for each scale and used to convolve the image consecutively, because a separable filter is expected to be specified by this array
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

UndecimatedWaveletTransform

public UndecimatedWaveletTransform(MTBImage _img,
                                   int _Jmax,
                                   boolean _denoise)
                            throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Constructor with default Gaussian kernel [1/16, 1/4, 3/8, 1/4, 1/16] for at most dimension x, y (and z if present).

Parameters:
img - input image
Jmax - maximum scale (2^Jmax - 1)
denoise - reduction of gaussian noise
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail

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 de.unihalle.informatik.Alida.operator.ALDOperator
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

inverseATrousDWT

protected MTBImage inverseATrousDWT(MTBImage[] dwt)
                             throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Inverse a trous DWT

Parameters:
dwt - DWT-coefficient images
Returns:
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

aTrousDWT

protected MTBImage[] aTrousDWT(MTBImage _img,
                               int _Jmax,
                               MTBImage[] _kernels)
                        throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                               de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
A trous DWT

Returns:
DWT-coefficient images ([0] lowpass coeffs, [1] highpass coeffs, [2] highest bandpass coeffs, ..., [Jmax] lowest bandpass coeffs)
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

conv

protected MTBImage conv(MTBImage img,
                        MTBImage[] scaleOneKernels,
                        int j)
                 throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                        de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Convolve input image with an 'a trous' kernel (zeros inserted) given the original kernel and scale j

Parameters:
img - input image
scaleOneKernels - original kernel (without inserted zeros)
j - scale parameter
Returns:
filtered image
Throws:
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

denoiseDWTJeffreys

protected void denoiseDWTJeffreys(MTBImage[] dwt,
                                  double scaleOneSigma,
                                  double[] sigmaScales)
Denoise wavelet coefficients using Jeffrey's noninformative prior [..]

Parameters:
dwt -
scaleOneSigma -
sigmaScales -

denoise

protected void denoise(MTBImage img,
                       double sigma)
Denoise wavelet coefficients using Jeffrey's noninformative prior for a given sigma of noise

Parameters:
img - input image
sigma - sigma of noise

computeSigmaScales

protected double[] computeSigmaScales()
                               throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException,
                                      de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Compute scaling factors of noise sigma for wavelet scales (these scaling factors are estimated using a gaussian noise image with sigma=1 to measure noise in the wavelet scales)

Parameters:
p - DWT configuration (only Jmax is important here)
Returns:
scaling factor of noise sigma for wavelet scale 1 to Jmax
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException

get3SigClippedStdDev

protected double get3SigClippedStdDev(MTBImage img)
Get the standard deviation (sigma) of an image only using values clipped by 3*sigma from a first estimate of sigma

Parameters:
img - input image
Returns:
3*sigma clipped std dev

getStdDev

protected double getStdDev(MTBImage img)
Get standard deviation of the image

Parameters:
img - input image
Returns:
sigma

createGaussianNoiseImage

protected MTBImage createGaussianNoiseImage(double mean,
                                            double sigma,
                                            double clippingFactor,
                                            int bins,
                                            int sizeX,
                                            int sizeY,
                                            int sizeZ,
                                            int sizeT,
                                            int sizeC)
Create an image with Gaussian noise

Parameters:
mean -
sigma -
clippingFactor -
bins -
sizeX -
sizeY -
sizeZ -
sizeT -
sizeC -
Returns:

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:

getDenoise

public boolean getDenoise()
Get the denoising flag. true if denoising is activated.


setDenoise

protected void setDenoise(boolean denoise)
Set the denoising flag. true to activate denoising.


getImg

public MTBImage getImg()
Get reference to the (input) image.

Returns:
Image domain image

setImg

public void setImg(MTBImage img)
Set the image domain image


getJmax

public int getJmax()
Get Jmax (maximum scale 2^Jmax - 1)


setJmax

protected void setJmax(int Jmax)
Set Jmax (maximum scale 2^Jmax - 1)

Parameters:
Jmax -

getKernels

protected MTBImage[] getKernels()
Get smoothing kernels


setKernels

protected void setKernels(MTBImage[] kernels)
Set smoothing kernels


isForwardTransform

public boolean isForwardTransform()
Test if parameter object is set to (forward) transform (image to wavelet)

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

setForwardTransform

public void setForwardTransform()
Toggle computation of the (forward) transform (image to wavelet)


isInverseTransform

public boolean isInverseTransform()
                           throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Test if parameter object is set to Inverse Transform (wavelet to image)

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

setInverseTransform

public void setInverseTransform()
                         throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Set computation of the inverse transform (wavelet to image)

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

getUWT

public MTBImageSet getUWT()
Get the UWT coefficient images. At index 0, the lowpass image stored. Indices j = 1,...,Jmax correspond to the UWT coefficients at scales 2^j - 1, meaning highpass at j=1, highest bandpass at j=2 and lowest bandpass at j=Jmax

Returns:
Reference to UWT images

setUWT

public void setUWT(MTBImageSet uwtImages)
Set UWT coefficient images


addStatusListener

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

removeStatusListener

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

notifyListeners

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


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