Class BiorthogonalWavelets
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.filters.BiorthogonalWavelets
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class BiorthogonalWavelets extends AlgorithmBase
Copyright (c) 2012, Brian Moore Copyright (c) 2004, Ben Barrowes All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions 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 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 THE COPYRIGHT OWNER 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 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
BiorthogonalWavelets.realImaginaryComparator
private class
BiorthogonalWavelets.realImaginaryItem
-
Field Summary
Fields Modifier and Type Field Description private float[]
absGtw
private float[]
absGw
private float[]
absHtw
private float[]
absHw
private int
CDF_type
private ModelImage
compressedTransformImage
private double
compressionFactor
private int
convolution_method
private boolean
display
private double
epsilon
D1MACH(4).private double[]
g
private double[]
gt
private double[]
GtwImag
private double[]
GtwReal
private double[]
GwImag
private double[]
GwReal
private double[]
h
private double[]
h1
private double[][]
hComplexRoots
private double[]
hRealRoots
private double[]
ht
private double[]
ht1
private double[][]
htComplexRoots
private double[]
htRealRoots
private double[]
HtwImag
private double[]
HtwReal
private double[]
HwImag
private double[]
HwReal
private int[]
inds_g
private int[]
inds_gt
private int[]
inds_h
private int[]
inds_ht
private int
iterations
private int
l
private int
lt
private int
method
private int
N
private int
Nt
private double[]
P
private ModelImage
reconstructedImage
private int
spline_type
private java.lang.String
str
private ModelImage
transformImage
private int
type
private int
waveletMatrix_method
-
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 BiorthogonalWavelets(ModelImage transformImage, ModelImage compressedTransformImage, ModelImage reconstructedImage, ModelImage srcImg, int iterations, double compressionFactor, boolean display, int method, int type, int len, int lent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
CDFWavelets()
private double[]
circshift(double[] vec, int shift)
private void
computeEpsilon()
private void
ComputeFilters()
private void
ComputeFrequencyResponse()
private void
computeRoots()
private double[]
conv(double[] u, double[] v)
private double[][]
cplxpair(double[][] p)
private double[]
diffBinomial(int n)
long
factorial(int number)
Returns the factorial of a nonnegative integer.private double[][]
FastConvWaveletMult(double[][] mat, double[] h, double[] g, int[] inds_h, int[] inds_g)
private long
nchoosek(int n, int k)
private double[][]
roots(double[] p)
void
runAlgorithm()
Actually runs the algorithm.void
SplineWavelets()
private double[][]
WaveletMatrix(int M, double[] h, double[] g, int[] inds_h, int[] inds_g)
private double
zabs(double zr, double zi)
zabs computes the absolute value or magnitude of a double precision complex variable zr + j*zi.-
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
-
CDF_type
private final int CDF_type
- See Also:
- Constant Field Values
-
spline_type
private final int spline_type
- See Also:
- Constant Field Values
-
waveletMatrix_method
private final int waveletMatrix_method
- See Also:
- Constant Field Values
-
convolution_method
private final int convolution_method
- See Also:
- Constant Field Values
-
epsilon
private double epsilon
D1MACH(4).
-
h
private double[] h
-
ht
private double[] ht
-
inds_h
private int[] inds_h
-
inds_ht
private int[] inds_ht
-
g
private double[] g
-
gt
private double[] gt
-
inds_g
private int[] inds_g
-
inds_gt
private int[] inds_gt
-
transformImage
private ModelImage transformImage
-
compressedTransformImage
private ModelImage compressedTransformImage
-
reconstructedImage
private ModelImage reconstructedImage
-
iterations
private int iterations
-
compressionFactor
private double compressionFactor
-
type
private int type
-
l
private int l
-
lt
private int lt
-
N
private int N
-
Nt
private int Nt
-
display
private boolean display
-
method
private int method
-
hRealRoots
private double[] hRealRoots
-
hComplexRoots
private double[][] hComplexRoots
-
htRealRoots
private double[] htRealRoots
-
htComplexRoots
private double[][] htComplexRoots
-
P
private double[] P
-
h1
private double[] h1
-
ht1
private double[] ht1
-
str
private java.lang.String str
-
HwReal
private double[] HwReal
-
HwImag
private double[] HwImag
-
absHw
private float[] absHw
-
HtwReal
private double[] HtwReal
-
HtwImag
private double[] HtwImag
-
absHtw
private float[] absHtw
-
GwReal
private double[] GwReal
-
GwImag
private double[] GwImag
-
absGw
private float[] absGw
-
GtwReal
private double[] GtwReal
-
GtwImag
private double[] GtwImag
-
absGtw
private float[] absGtw
-
-
Constructor Detail
-
BiorthogonalWavelets
public BiorthogonalWavelets(ModelImage transformImage, ModelImage compressedTransformImage, ModelImage reconstructedImage, ModelImage srcImg, int iterations, double compressionFactor, boolean display, int method, int type, int len, int lent)
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBase
Actually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithm
in classAlgorithmBase
-
computeEpsilon
private void computeEpsilon()
-
CDFWavelets
public void CDFWavelets()
-
SplineWavelets
public void SplineWavelets()
-
diffBinomial
private double[] diffBinomial(int n)
-
FastConvWaveletMult
private double[][] FastConvWaveletMult(double[][] mat, double[] h, double[] g, int[] inds_h, int[] inds_g)
-
WaveletMatrix
private double[][] WaveletMatrix(int M, double[] h, double[] g, int[] inds_h, int[] inds_g)
-
circshift
private double[] circshift(double[] vec, int shift)
-
conv
private double[] conv(double[] u, double[] v)
-
roots
private double[][] roots(double[] p)
-
cplxpair
private double[][] cplxpair(double[][] p)
-
zabs
private double zabs(double zr, double zi)
zabs computes the absolute value or magnitude of a double precision complex variable zr + j*zi.- Parameters:
zr
- doublezi
- double- Returns:
- double
-
nchoosek
private long nchoosek(int n, int k)
-
factorial
public long factorial(int number)
Returns the factorial of a nonnegative integer.- Parameters:
number
- integer whose factorial is being returned- Returns:
- number!
-
ComputeFilters
private void ComputeFilters()
-
ComputeFrequencyResponse
private void ComputeFrequencyResponse()
-
computeRoots
private void computeRoots()
-
-