Class AlgorithmTimeFitting

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

    public class AlgorithmTimeFitting
    extends AlgorithmBase
    • Field Detail

      • MULTIEXPONENTIAL_FIT

        private static final int MULTIEXPONENTIAL_FIT
        From Exponential analysis in physical phenomena by Andrei A. Istratov and Oleg F. Vyvenko: Note that for a multiexponential fit nonlinear least squares analysis as used here can handle nonzero baseline offsets. However, for nonlinear least squares initial guesses are needed for the values of unknown decay parameters and, if these initial guesses are poor, the iteration may converge to a local minimum rather than to the absolute minimum. With Prony's method the baseline offset should be removed first. The differentiation of transients only allows the exponent time constants to be determined. It does not allow the amplitudes by which the exponents are multiplied to be determined. Also experimental transients are noisy, and large errors would result from their numerical differentiation. The method of modulating functions does not enable one to determine the amplitude of the transients and is not tolerant to nonzero baseline offsets. The integration method allows one to determine the baseline. However, the solution is more stable and exact if the baseline is subtracted from the raw signal before the analysis. For the integration method, on computed two-component decays with tau1/tau2 = 2.5 the reliable separation of components is impossible if the SNR is less than 30. For tau1/tau2, two components can be separated for a SNR of about 10. When two-component analysis is performed with a baseline determination the mean error of the calculated time constants increases by a factor of about 3-10. Before the method of moments can be applied, the baseline offset must be removed from the data. The Laplace-Pade approximation is not applicable to decays containing baseline offset. Tolerance of the method to baseline offsets may be very important, depending on whether a baseline offset can be encountered in the experiment. Few of the discussed techniques are tolerable of nonzero baseline offsets. Such commonly used methods as Prony's or method of moments will provide wrong results or even crash if a decay contains an offset. Unfortunately, algorithms for extrapolation of baseline offsets are poorly developed and are not always sufficiently exact. Therefore, we would recommend algorithms that do not require baseline corrections and can accommodate transients with a baseline. Taking into account stability for wide range changes in parameters and insensitivity to baseline offsets, the authors select nonlinear least squares as the best fitting method for multiexponential fits. Fitting routines are only accurate if the number of components is correct and the initial approximation is close to the true solution. A way to obtain this initial approximation is to extract it from a spectroscopic method, as was done by Provencher and Mazzola et al.
        See Also:
        Constant Field Values
      • timeVals

        private double[] timeVals
        A vector of center times for each volume
      • srcArray

        private double[] srcArray
      • i

        private int i
      • xDim

        private int xDim
      • yDim

        private int yDim
      • zDim

        private int zDim
      • tDim

        private int tDim
      • volSize

        private int volSize
      • findInitialFromData

        private boolean findInitialFromData
      • initial

        private double[] initial
      • useBounds

        private boolean[] useBounds
      • lowBounds

        private double[] lowBounds
      • highBounds

        private double[] highBounds
      • exitStatus

        private int[] exitStatus
      • paramNaN

        private int[] paramNaN
      • paramInf

        private int[] paramInf
      • paramMin

        private double[] paramMin
      • paramMax

        private double[] paramMax
      • paramTotal

        private double[] paramTotal
      • paramAverage

        private double[] paramAverage
      • processors

        private int processors
      • destArray

        private double[] destArray
      • destExitStatusArray

        private int[] destExitStatusArray
      • voxelsProcessed

        private long voxelsProcessed
      • barMarker

        private int barMarker
      • oldBarMarker

        private int oldBarMarker
      • bitMask

        private java.util.BitSet bitMask
      • validVoxels

        private int validVoxels
      • wholeImage

        private boolean wholeImage
      • exitStatusImage

        private ModelImage exitStatusImage
      • useLog

        private boolean useLog
      • functionFit

        private int functionFit
      • numVariables

        private int numVariables
      • useAltTimeTag

        private boolean useAltTimeTag
      • altTimeTag

        private java.lang.String altTimeTag
    • Constructor Detail

      • AlgorithmTimeFitting

        public AlgorithmTimeFitting​(ModelImage destImage,
                                    ModelImage srcImage,
                                    ModelImage exitStatusImage,
                                    boolean useLog,
                                    int functionFit,
                                    int numVariables,
                                    boolean findInitialFromData,
                                    double[] initial,
                                    boolean[] useBounds,
                                    double[] lowBounds,
                                    double[] highBounds)
        Creates a new AlgorithmTimeFitting object.
      • AlgorithmTimeFitting

        public AlgorithmTimeFitting​(ModelImage destImage,
                                    ModelImage srcImage,
                                    ModelImage exitStatusImage,
                                    boolean useLog,
                                    int functionFit,
                                    int numVariables,
                                    boolean findInitialFromData,
                                    double[] initial,
                                    boolean[] useBounds,
                                    double[] lowBounds,
                                    double[] highBounds,
                                    boolean useAltTimeTag,
                                    java.lang.String altTimeTag)
        Creates a new AlgorithmTimeFitting object.
    • Method Detail

      • finalize

        public void finalize()
        Prepares this class for destruction.
        Overrides:
        finalize in class AlgorithmBase
      • input

        public void input​(double[] y_array,
                          int i)
      • output

        public void output​(double[] params,
                           int i,
                           int status,
                           double chi_squared)