Package gov.nih.mipav.model.algorithms
Class AlgorithmMultiExponentialFitting
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmMultiExponentialFitting
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmMultiExponentialFitting extends AlgorithmBase
-
-
Field Summary
Fields Modifier and Type Field Description private double[][]
adub
private double
chiSquared
private double
convrg
private double[][]
ddse
private double
delta
private double[]
deltap
private double[]
deltat
private double[][]
df
private double[][]
dfcapl
private double[][]
dgfl
private double
dgride
private double
dgridf
private double[]
dtoler
private double[][]
e
private double
enphi
private int
evarCalled
private double[][]
f
private boolean
failed
private boolean
fatalProblem
private boolean[][]
ffail
private double[]
fhat
private double
fhatmx
private double
gestl
private double[][]
gf
private double
gfstl
private double[][]
gse
private int
ibase
private int
iter
private int
iwt
private int
iwtsgn
private int
jgeadd
private int
jlamp1
private double[][][]
lamf
private double[][]
lamnmx
private double[]
lamst
private int
mdima
private int
minter
private int
mlammx
private int
mtry
private int
n
private int[][]
nbinom
private int
nf
private int[]
nftry
private int[]
ngrid2
private int
nint
private int
nintmx
This is a port of the Fortran program discrete.for version 2B (December, 1990) written by Stephen Provencher, PhD.private int
nlammx
private boolean
nobase
private boolean
nonneg
private int[]
nperg2
private int[]
nt
private int[]
nvgrid
private double[]
palpha
private double[]
params
private double[]
pcerr
private boolean[]
pivalp
private double[]
plam
private double[]
plmtry
private boolean
plotrs
private double
precis
private boolean
prfinl
private boolean
prprel
private boolean
pry
private boolean
regint
private boolean
repeat
private double[][]
se
private double[]
sfde
private boolean
showDebug
private double[]
sigmap
private double
sigyy
private double[]
sqrtw
private int
status
private double
sumwt
private double
sumwty
private double[]
t
private double[]
tend
private double[]
trbase
private double[]
tstart
private double[]
var
private int
varfCalled
private double
varmin
private double[]
vgrid2
private boolean
wted
private double[]
y
private double[]
ylyfit
private double[]
zero
-
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 AlgorithmMultiExponentialFitting()
AlgorithmMultiExponentialFitting(int nlammx, int iwt, int mtry, boolean regint, boolean nobase, boolean nonneg, boolean showDebug, boolean pry, boolean prprel, boolean prfinl, boolean plotrs, boolean repeat, int n, double[] t, int nint, double[] tstart, double[] tend, int[] nt, double[] y, double[] sqrtw)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
anlerr(int jlam, int nlin, int itype, boolean inter, boolean prlsq)
private void
etheor(double plambd, boolean invert, boolean wted, double[] se, double[] dse, double[] ddse, double[] sye, boolean doe, boolean doye)
private void
evar(double[] q, int jlam, double[] var, boolean invert, boolean[] allpiv, double[] ylydum, int nlin, double varg, int ntry, boolean inter, int[] ierror)
private double
expsma(double s)
private void
fanlyz()
void
finalize()
Prepares this class for destruction.private double
fisher(double fs, int nu1, int nu2)
double
getChiSquared()
double[]
getParameters()
int
getStatus()
private void
lstsqr(double[] lamst, int jlam, boolean rawdat, int n, int nlin, int routineCalled, int itype, boolean split, boolean inter, boolean prlsq)
private void
pivot(double[][] adub, int mdima, int np, boolean onlyin, boolean invert, boolean constr, double pmin, double pmax, double[] p, double[] dtoler, double[] deltap, boolean[] allpiv, double[] qg, boolean[] piv, int jlam, double[] qmax, int[] ierror)
private void
pivot1(double[][] adub, int mdima, int npp, int lpiv)
private void
residu(int jlam, boolean plot, double[] puncor, double[][][] asave)
void
runAlgorithm()
starts the algorithm.void
selfTest()
private void
varf(double[] q, int jlam, double[] var, boolean invert, boolean[] allpiv, double[] ylyfit, int nlin, double varg, int ntry, boolean intdum, int[] ierror)
private void
weight(boolean finalVar)
private void
yanlyz()
-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, 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
-
nintmx
private int nintmx
This is a port of the Fortran program discrete.for version 2B (December, 1990) written by Stephen Provencher, PhD. The README.txt file has: DISCLAIMER: This software and its documentation are free and come "as is" with absolutely no guarantee and no support. Applications: Analysis of multi-exponential decay data. Running in hundreds of laboratories on a wide variety of computers. Methods: Fully automatic: no starting estimates needed for the number of exponentials or for their parameters; Modified Gauss-Newton least squares, with intensive searches from many starting points to find the global optimum; Methods in the references below are used to get starting estimates and to speed up the analysis: References: I) S.W. Provencher: A Fourier Method for the Analysis of Exponential Decay Curves, Biophysical Journal, Vol. 16, pp. 27-41 (1976). II)S.W. Provencher: An eigenfunction expansion method for the analysis of exponential decay curves. J. Chem. Phys. 64, pp. 2772-2777. (1976). III)S.W. Provencher & R.H. Vogel: Information loss with transform methods in system identification: A new set of transforms with high information content. Math. Biosci. 50, pp. 251-262 (1980). IV)S.W. Provencher & R.H. Vogel: Regularization techniques for inverse problems in molecular biology in: Numerical Treatment of Inverse Problems in Differential and Integral Equations, eds. P. Deuflhard & E. Hairer (Birkhauser, Boston, 1983), pp. 304-319. This program is used for the automatic analysis of multicomponent exponential decay for up to 9 components. Download the Users Manual and other essential documentation from http://S-provencher.com. The data is represented by y[k] = sum from j = 0 to nlambda of alpha[j]*exp(-lambda[j] * t[k]), k = 1, 2, ..., n, with nlambda varied from 1 to nlammx with nlammx <= mlammx = 9. Provision can be make for an unknown baseline component alpha[0] with lambda[0] = 0. It is completely automatic in that only the raw data y[k] and t[k] are input; no potentially biased initial guesses at alpha[j], lambda[j], or even the number of terms nlambda are needed or even allowed. There is no need to normalize any of the input data like tstart, tend, t, y, or sqrtw. However, the number 1.0E20 has been used throughout the program to represent an infinitely large number and hence nothing should get larger than 1.0E20. Since some of the values are squared and summed over n, it is best to choose units so that all input values are between 1.0E-9 and 1.0E6 in absolute value. runAlgorithm calls routines weight, fanlyz, yanlyz which in turn call lstSqr, evar, varf, etheor, pivot, pivot1, anlerr, fisher, residu.
-
mlammx
private int mlammx
-
convrg
private double convrg
-
ngrid2
private int[] ngrid2
-
minter
private int minter
-
sigmap
private double[] sigmap
-
precis
private double precis
-
nlammx
private int nlammx
-
iwt
private int iwt
-
mtry
private int mtry
-
regint
private boolean regint
-
nobase
private boolean nobase
-
nonneg
private boolean nonneg
-
showDebug
private boolean showDebug
-
pry
private boolean pry
-
prprel
private boolean prprel
-
prfinl
private boolean prfinl
-
plotrs
private boolean plotrs
-
repeat
private boolean repeat
-
fatalProblem
private boolean fatalProblem
-
n
private int n
-
t
private double[] t
-
nint
private int nint
-
tstart
private double[] tstart
-
tend
private double[] tend
-
nt
private int[] nt
-
y
private double[] y
-
sqrtw
private double[] sqrtw
-
ylyfit
private double[] ylyfit
-
e
private double[][] e
-
gse
private double[][] gse
-
deltat
private double[] deltat
-
evarCalled
private int evarCalled
-
varfCalled
private int varfCalled
-
trbase
private double[] trbase
-
gf
private double[][] gf
-
dgfl
private double[][] dgfl
-
dgridf
private double dgridf
-
gfstl
private double gfstl
-
fhat
private double[] fhat
-
varmin
private double varmin
-
sumwty
private double sumwty
-
sumwt
private double sumwt
-
zero
private double[] zero
-
dgride
private double dgride
-
gestl
private double gestl
-
var
private double[] var
-
palpha
private double[] palpha
-
plam
private double[] plam
-
se
private double[][] se
-
plmtry
private double[] plmtry
-
deltap
private double[] deltap
-
dfcapl
private double[][] dfcapl
-
sfde
private double[] sfde
-
adub
private double[][] adub
-
ddse
private double[][] ddse
-
dtoler
private double[] dtoler
-
f
private double[][] f
-
df
private double[][] df
-
delta
private double delta
-
fhatmx
private double fhatmx
-
lamst
private double[] lamst
-
lamf
private double[][][] lamf
-
lamnmx
private double[][] lamnmx
-
sigyy
private double sigyy
-
enphi
private double enphi
-
pcerr
private double[] pcerr
-
vgrid2
private double[] vgrid2
-
jgeadd
private int jgeadd
-
nbinom
private int[][] nbinom
-
nvgrid
private int[] nvgrid
-
nperg2
private int[] nperg2
-
mdima
private int mdima
-
ibase
private int ibase
-
iwtsgn
private int iwtsgn
-
nf
private int nf
-
iter
private int iter
-
jlamp1
private int jlamp1
-
nftry
private int[] nftry
-
failed
private boolean failed
-
wted
private boolean wted
-
ffail
private boolean[][] ffail
-
pivalp
private boolean[] pivalp
-
params
private double[] params
-
chiSquared
private double chiSquared
-
status
private int status
-
-
Constructor Detail
-
AlgorithmMultiExponentialFitting
public AlgorithmMultiExponentialFitting(int nlammx, int iwt, int mtry, boolean regint, boolean nobase, boolean nonneg, boolean showDebug, boolean pry, boolean prprel, boolean prfinl, boolean plotrs, boolean repeat, int n, double[] t, int nint, double[] tstart, double[] tend, int[] nt, double[] y, double[] sqrtw)
-
AlgorithmMultiExponentialFitting
public AlgorithmMultiExponentialFitting()
-
-
Method Detail
-
selfTest
public void selfTest()
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
getParameters
public double[] getParameters()
-
getChiSquared
public double getChiSquared()
-
getStatus
public int getStatus()
-
runAlgorithm
public void runAlgorithm()
starts the algorithm.- Specified by:
runAlgorithm
in classAlgorithmBase
-
weight
private void weight(boolean finalVar)
-
lstsqr
private void lstsqr(double[] lamst, int jlam, boolean rawdat, int n, int nlin, int routineCalled, int itype, boolean split, boolean inter, boolean prlsq)
-
pivot
private void pivot(double[][] adub, int mdima, int np, boolean onlyin, boolean invert, boolean constr, double pmin, double pmax, double[] p, double[] dtoler, double[] deltap, boolean[] allpiv, double[] qg, boolean[] piv, int jlam, double[] qmax, int[] ierror)
-
pivot1
private void pivot1(double[][] adub, int mdima, int npp, int lpiv)
-
evar
private void evar(double[] q, int jlam, double[] var, boolean invert, boolean[] allpiv, double[] ylydum, int nlin, double varg, int ntry, boolean inter, int[] ierror)
-
varf
private void varf(double[] q, int jlam, double[] var, boolean invert, boolean[] allpiv, double[] ylyfit, int nlin, double varg, int ntry, boolean intdum, int[] ierror)
-
anlerr
private void anlerr(int jlam, int nlin, int itype, boolean inter, boolean prlsq)
-
etheor
private void etheor(double plambd, boolean invert, boolean wted, double[] se, double[] dse, double[] ddse, double[] sye, boolean doe, boolean doye)
-
expsma
private double expsma(double s)
-
fanlyz
private void fanlyz()
-
yanlyz
private void yanlyz()
-
fisher
private double fisher(double fs, int nu1, int nu2)
-
residu
private void residu(int jlam, boolean plot, double[] puncor, double[][][] asave)
-
-