Class AlgorithmRiceWaveletTools
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.filters.AlgorithmRiceWaveletTools
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmRiceWaveletTools extends AlgorithmBase
This "rice-wlet-tools", version 2.4 Released -CONDITIONS FOR USE: Copyright (c) 2000 RICE UNIVERSITY. All rights reserved. This software is distributed and licensed to you on a non-exclusive basis, free-of-charge. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistribution in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgment: This product includes software developed by Rice University, Houston, Texas and its contributors. 4. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY WILLIAM MARSH RICE UNIVERSITY, HOUSTON, TEXAS, AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RICE UNIVERSITY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTIONS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE), PRODUCT LIABILITY, OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. For information on commercial licenses, contact Rice University's Office of Technology Transfer at techtran@rice.edu or (713) 348-6173
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
AlgorithmRiceWaveletTools.EigenvalueComplex
(package private) class
AlgorithmRiceWaveletTools.EigenvalueComplexComparator
-
Field Summary
Fields Modifier and Type Field Description private double[]
aArray
private double
actualThreshold
private boolean
doBayesShrinkThresholdComputation
private boolean
doDenoise
private boolean
doWaveletImages
private int
error
private int[]
extents
private int
filterLength
private int
filterType
static int
HARD_THRESHOLDING
private double[][]
hhA
private double[][]
hlA
private double[][]
lhA
private double[][]
llA
static int
MAD
static int
MAXIMUM_PHASE
private int
maximumLevel
static int
MID_PHASE
static int
MINIMUM_PHASE
private int
minimumLevel
private int
nDims
private double[]
noiseStandardDeviation
private int
numberOfLevels
private boolean
redundant
private double[]
scalingFilter
private int
sliceSize
static int
SOFT_THRESHOLDING
static int
STD
private int
thresholdingType
private boolean
thresholdLowPass
private double
thresholdMultiplier
private boolean
useNoiseStdConstructor
private int
varianceEstimator
private double[]
waveletFilter
private ModelImage[]
waveletImage
private int
xDim
private double[]
y
private int
yDim
private double[]
yl
private int
z
private int
zDim
-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmRiceWaveletTools()
AlgorithmRiceWaveletTools(ModelImage srcImg, double[] noiseStandardDeviation)
AlgorithmRiceWaveletTools(ModelImage srcImg, int filterLength, boolean redundant, int numberOfLevels, boolean doWaveletImages, int minimumLevel, int maximumLevel, int filterType, boolean doDenoise, double actualThreshold, int varianceEstimator, double thresholdMultiplier, int thresholdingType, boolean thresholdLowPass, boolean doBayesShrinkThresholdComputation)
AlgorithmRiceWaveletTools(ModelImage destImg, ModelImage srcImg, int filterLength, boolean redundant, int numberOfLevels, boolean doWaveletImages, int minimumLevel, int maximumLevel, int filterType, boolean doDenoise, double actualThreshold, int varianceEstimator, double thresholdMultiplier, int thresholdingType, boolean thresholdLowPass, boolean doBayesShrinkThresholdComputation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private double
BayesShrinkThresholdComputation(double[] data, double noise_var)
private void
bpconv(double[] x_out, int lx, double[] g0, double[] g1, int lh, double[] x_inl, double[] x_inh)
private void
bpsconv(double[] x_out, int lx, double[] g0, double[] g1, int lhm1, int lhhm1, double[] x_inl, double[] x_inh)
private void
daubcqf()
Function computes the Daubechies' scaling and wavelet filters (normalized to sqrt(2)).private void
fpconv(double[] x_in, int lx, double[] h0, double[] h1, int lh, double[] x_outl, double[] x_outh)
private void
fpsconv(double[] x_in, int lx, double[] h0, double[] h1, int lhm1, double[] x_outl, double[] x_outh)
ModelImage[]
getWaveletImages()
Accessor that returns the image.private void
makeSig(java.lang.String sigName, int signalLength)
private void
mdwt()
void
midwt()
void
mirdwt()
private void
mrdwt()
void
runAlgorithm()
Actually runs the algorithm.void
signalTest()
void
test_denoise_2D()
void
test_denoise_actual_thresh()
void
test_denoise_default()
void
test_denoise_hard()
void
test_denoise_levels()
void
test_denoise_std()
void
test_denoise_thresh_multiplier()
void
test_denoise_threshold_low()
void
test_denoise_udwt()
void
test_denoise_udwt_2d()
void
test_denoise_udwt_actual_thresh()
void
test_denoise_udwt_levels()
void
test_denoise_udwt_soft()
void
test_denoise_udwt_std()
void
test_denoise_udwt_thresh_multiplier()
void
test_denoise_udwt_threshold_low()
void
test_mdwt_1D()
void
test_mdwt_2D()
void
test_midwt_1D()
void
test_midwt_2D()
void
test_mirdwt_1()
void
test_mirdwt_2D()
void
test_mrdwt_1()
void
test_mrdwt_2()
void
test_mrdwt_2L2()
-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
MINIMUM_PHASE
public static final int MINIMUM_PHASE
- See Also:
- Constant Field Values
-
MID_PHASE
public static final int MID_PHASE
- See Also:
- Constant Field Values
-
MAXIMUM_PHASE
public static final int MAXIMUM_PHASE
- See Also:
- Constant Field Values
-
MAD
public static final int MAD
- See Also:
- Constant Field Values
-
STD
public static final int STD
- See Also:
- Constant Field Values
-
SOFT_THRESHOLDING
public static final int SOFT_THRESHOLDING
- See Also:
- Constant Field Values
-
HARD_THRESHOLDING
public static final int HARD_THRESHOLDING
- See Also:
- Constant Field Values
-
filterLength
private int filterLength
-
filterType
private int filterType
-
scalingFilter
private double[] scalingFilter
-
waveletFilter
private double[] waveletFilter
-
nDims
private int nDims
-
extents
private int[] extents
-
xDim
private int xDim
-
yDim
private int yDim
-
sliceSize
private int sliceSize
-
zDim
private int zDim
-
aArray
private double[] aArray
-
error
private int error
-
numberOfLevels
private int numberOfLevels
-
redundant
private boolean redundant
-
doWaveletImages
private boolean doWaveletImages
-
waveletImage
private ModelImage[] waveletImage
-
yl
private double[] yl
-
llA
private double[][] llA
-
lhA
private double[][] lhA
-
hlA
private double[][] hlA
-
hhA
private double[][] hhA
-
y
private double[] y
-
minimumLevel
private int minimumLevel
-
maximumLevel
private int maximumLevel
-
z
private int z
-
doDenoise
private boolean doDenoise
-
actualThreshold
private double actualThreshold
-
varianceEstimator
private int varianceEstimator
-
thresholdMultiplier
private double thresholdMultiplier
-
thresholdingType
private int thresholdingType
-
thresholdLowPass
private boolean thresholdLowPass
-
noiseStandardDeviation
private double[] noiseStandardDeviation
-
useNoiseStdConstructor
private boolean useNoiseStdConstructor
-
doBayesShrinkThresholdComputation
private boolean doBayesShrinkThresholdComputation
-
-
Constructor Detail
-
AlgorithmRiceWaveletTools
public AlgorithmRiceWaveletTools()
-
AlgorithmRiceWaveletTools
public AlgorithmRiceWaveletTools(ModelImage destImg, ModelImage srcImg, int filterLength, boolean redundant, int numberOfLevels, boolean doWaveletImages, int minimumLevel, int maximumLevel, int filterType, boolean doDenoise, double actualThreshold, int varianceEstimator, double thresholdMultiplier, int thresholdingType, boolean thresholdLowPass, boolean doBayesShrinkThresholdComputation)
-
AlgorithmRiceWaveletTools
public AlgorithmRiceWaveletTools(ModelImage srcImg, int filterLength, boolean redundant, int numberOfLevels, boolean doWaveletImages, int minimumLevel, int maximumLevel, int filterType, boolean doDenoise, double actualThreshold, int varianceEstimator, double thresholdMultiplier, int thresholdingType, boolean thresholdLowPass, boolean doBayesShrinkThresholdComputation)
-
AlgorithmRiceWaveletTools
public AlgorithmRiceWaveletTools(ModelImage srcImg, double[] noiseStandardDeviation)
-
-
Method Detail
-
signalTest
public void signalTest()
-
test_mrdwt_1
public void test_mrdwt_1()
-
test_mrdwt_2
public void test_mrdwt_2()
-
test_mrdwt_2L2
public void test_mrdwt_2L2()
-
test_mirdwt_1
public void test_mirdwt_1()
-
test_mirdwt_2D
public void test_mirdwt_2D()
-
test_mdwt_1D
public void test_mdwt_1D()
-
test_mdwt_2D
public void test_mdwt_2D()
-
test_midwt_1D
public void test_midwt_1D()
-
test_midwt_2D
public void test_midwt_2D()
-
test_denoise_default
public void test_denoise_default()
-
test_denoise_2D
public void test_denoise_2D()
-
test_denoise_udwt
public void test_denoise_udwt()
-
test_denoise_udwt_2d
public void test_denoise_udwt_2d()
-
test_denoise_threshold_low
public void test_denoise_threshold_low()
-
test_denoise_thresh_multiplier
public void test_denoise_thresh_multiplier()
-
test_denoise_std
public void test_denoise_std()
-
test_denoise_hard
public void test_denoise_hard()
-
test_denoise_levels
public void test_denoise_levels()
-
test_denoise_actual_thresh
public void test_denoise_actual_thresh()
-
test_denoise_udwt_threshold_low
public void test_denoise_udwt_threshold_low()
-
test_denoise_udwt_thresh_multiplier
public void test_denoise_udwt_thresh_multiplier()
-
test_denoise_udwt_std
public void test_denoise_udwt_std()
-
test_denoise_udwt_soft
public void test_denoise_udwt_soft()
-
test_denoise_udwt_levels
public void test_denoise_udwt_levels()
-
test_denoise_udwt_actual_thresh
public void test_denoise_udwt_actual_thresh()
-
BayesShrinkThresholdComputation
private double BayesShrinkThresholdComputation(double[] data, double noise_var)
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBase
Actually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithm
in classAlgorithmBase
-
makeSig
private void makeSig(java.lang.String sigName, int signalLength)
-
mdwt
private void mdwt()
-
mrdwt
private void mrdwt()
-
fpconv
private void fpconv(double[] x_in, int lx, double[] h0, double[] h1, int lh, double[] x_outl, double[] x_outh)
-
fpsconv
private void fpsconv(double[] x_in, int lx, double[] h0, double[] h1, int lhm1, double[] x_outl, double[] x_outh)
-
midwt
public void midwt()
-
mirdwt
public void mirdwt()
-
bpsconv
private void bpsconv(double[] x_out, int lx, double[] g0, double[] g1, int lhm1, int lhhm1, double[] x_inl, double[] x_inh)
-
bpconv
private void bpconv(double[] x_out, int lx, double[] g0, double[] g1, int lh, double[] x_inl, double[] x_inh)
-
daubcqf
private void daubcqf()
Function computes the Daubechies' scaling and wavelet filters (normalized to sqrt(2)). The user specifies an even number filter length and a minimum phase, mid phase, or maximum phase solution. Reference: "Orthonormal Bases of Compactly Supported Wavelets", CPAM, October, 1989. From the original source file: %File Name: daubcqf.m %Last Modification Date: 01/02/96 15:12:57 %Current Version: daubcqf.m 2.4 %File Creation Date: 10/10/88 %Author: Ramesh Gopinath% %Copyright (c) 2000 RICE UNIVERSITY. All rights reserved. %Created by Ramesh Gopinath, Department of ECE, Rice University. Correctly gives scaling and wavelet filters for filter length = 4 minimum phase: Calculated scaling filter: 0.48296291314453416 0.8365163037378078 0.2241438680420134 -0.12940952255126037 Calculated Wavelet filter: 0.12940952255126037 0.2241438680420134 -0.8365163037378078 0.48296291314453416 Correct scaling filter = [0.482962913144534 0.836516303737808 0.224143868042013 -0.129409522551260]; Correct wavelet filter = [0.129409522551260 0.224143868042013 -0.836516303737808 0.482962913144534]; Correctly gives scaling and wavelet filters for filter length = 4 mid phase Calculated scaling filter: 0.48296291314453416 0.8365163037378078 0.2241438680420134 -0.12940952255126037 Calculated wavelet filter: 0.12940952255126037 0.2241438680420134 -0.8365163037378078 0.48296291314453416 Correct scaling filter = [0.482962913144534 0.836516303737808 0.224143868042013 -0.129409522551260]; Corrct wavelet filter = [0.129409522551260 0.224143868042013 -0.836516303737808 0.482962913144534]; Correctly gives scaling and wavelet filters for filter length = 4 maximum phase Calculated scaling filter: -0.12940952255126037 0.2241438680420134 0.8365163037378078 0.48296291314453416 Calculated wavelet filter: -0.48296291314453416 0.8365163037378078 -0.2241438680420134 -0.12940952255126037 Correct scaling filter = [-0.129409522551260 0.224143868042013 0.836516303737808 0.482962913144534]; Correct wavelet filter = [-0.482962913144534 0.836516303737808 -0.224143868042013 -0.129409522551260]; Correctly gives scaling and wavelet filters for filter length = 6 minimum phase Scaling filter: 0.3326705529500828 0.8068915093110931 0.459877502118492 -0.1350110200102549 -0.08544127388202716 0.03522629188570937 Wavelet filter: -0.03522629188570937 -0.08544127388202716 0.1350110200102549 0.459877502118492 -0.8068915093110931 0.3326705529500828 Correctly gives scaling and wavelet filters for filter length = 6 mid phase Scaling filter: 0.3326705529500828 0.8068915093110931 0.459877502118492 -0.1350110200102549 -0.08544127388202716 0.03522629188570937 Wavelet filter: -0.03522629188570937 -0.08544127388202716 0.1350110200102549 0.459877502118492 -0.8068915093110931 0.3326705529500828 Correct scaling filter = [0.332670552950083 0.806891509311093 0.459877502118491 -0.135011020010255 -0.085441273882027 0.035226291885710]; Correct wavelet filter = [-0.035226291885710 -0.085441273882027 0.135011020010255 0.459877502118491 -0.806891509311093 0.332670552950083];
-
getWaveletImages
public ModelImage[] getWaveletImages()
Accessor that returns the image.- Returns:
- the wavelet image
-
-