Class AlgorithmTreT2

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

    public class AlgorithmTreT2
    extends AlgorithmTProcess
    This class is adapted from the ImageJ version originally written by Sean Deoni while working at the National Institutes of Health. This class performs T2 calculations given any number of SPGR images.
    • Field Detail

      • treFA_phase0

        private final double[] treFA_phase0
      • treFA_phase180

        private final double[] treFA_phase180
      • simplexLineValues

        private double[] simplexLineValues
      • simplexResiduals

        private double[] simplexResiduals
      • simplexCentre

        private double[] simplexCentre
      • reflection

        private double[] reflection
      • expansion

        private double[] expansion
      • contraction

        private double[] contraction
      • shrink

        private double[] shrink
      • simplex

        private double[][] simplex
      • twoPSimplexLineValues

        private double[] twoPSimplexLineValues
      • twoPSimplexResiduals

        private double[] twoPSimplexResiduals
      • twoPSimplexCentre

        private double[] twoPSimplexCentre
      • twoPReflection

        private double[] twoPReflection
      • twoPExpansion

        private double[] twoPExpansion
      • twoPContraction

        private double[] twoPContraction
      • twoPShrink

        private double[] twoPShrink
      • twoPSimplex

        private double[][] twoPSimplex
      • bestToWorst

        private int[] bestToWorst
      • hardInterrupt

        private boolean hardInterrupt
      • t2ResultWindow

        private ViewJFrameImage t2ResultWindow
        The frames for result images (if null at end of algorithm src ModelImage is destroyed)
      • ssfpImageNames_phase0

        private java.lang.String[] ssfpImageNames_phase0
      • ssfpImageNames_phase180

        private java.lang.String[] ssfpImageNames_phase180
      • t1ImageName

        private java.lang.String t1ImageName
      • b1ImageName

        private java.lang.String b1ImageName
      • dialog

        private final JDialogTreT2 dialog
        The dialog for accessing GUI specific information, also set during scripting.
    • Constructor Detail

      • AlgorithmTreT2

        public AlgorithmTreT2​(JDialogTreT2 dialog,
                              double[] treFAPhase0,
                              double[] treFAPhase180,
                              java.lang.String[] ssfpImageNamesPhase0,
                              java.lang.String[] ssfpImageNamesPhase180,
                              java.lang.String t1ImageName,
                              java.lang.String b1ImageName,
                              double[] simplexLineValues,
                              double[] simplexResiduals,
                              double[] simplexCentre,
                              double[] reflection,
                              double[] expansion,
                              double[] contraction,
                              double[] shrink,
                              double[][] simplex,
                              double[] twoPSimplexLineValues,
                              double[] twoPSimplexResiduals,
                              double[] twoPSimplexCentre,
                              double[] twoPReflection,
                              double[] twoPExpansion,
                              double[] twoPContraction,
                              double[] twoPShrink,
                              double[][] twoPSimplex,
                              int[] bestToWorst,
                              java.lang.String[] wList)
      • AlgorithmTreT2

        public AlgorithmTreT2​(ModelImage destImage,
                              ModelImage srcImage,
                              JDialogTreT2 dialog,
                              double[] treFAPhase0,
                              double[] treFAPhase180,
                              java.lang.String[] ssfpImageNamesPhase0,
                              java.lang.String[] ssfpImageNamesPhase180,
                              java.lang.String t1ImageName,
                              java.lang.String b1ImageName,
                              double[] simplexLineValues,
                              double[] simplexResiduals,
                              double[] simplexCentre,
                              double[] reflection,
                              double[] expansion,
                              double[] contraction,
                              double[] shrink,
                              double[][] simplex,
                              double[] twoPSimplexLineValues,
                              double[] twoPSimplexResiduals,
                              double[] twoPSimplexCentre,
                              double[] twoPReflection,
                              double[] twoPExpansion,
                              double[] twoPContraction,
                              double[] twoPShrink,
                              double[][] twoPSimplex,
                              int[] bestToWorst,
                              java.lang.String[] wList)
    • Method Detail

      • finalize

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

        public void runAlgorithm()
        Description copied from class: AlgorithmBase
        Actually runs the algorithm. Implemented by inheriting algorithms.
        Specified by:
        runAlgorithm in class AlgorithmBase
      • calculateT2with0Phase

        public void calculateT2with0Phase()
      • calculateT2with180Phase

        public void calculateT2with180Phase()
      • calculateT2withApproximateModeling

        public void calculateT2withApproximateModeling()
      • calculateT2withFullModeling

        public void calculateT2withFullModeling()
      • twoPDownHillSimplex

        public void twoPDownHillSimplex​(double[] optimization,
                                        double[] initialGuess,
                                        double b0,
                                        double t1,
                                        double tr,
                                        double[] ssfpSampleData,
                                        double[] sina,
                                        double[] cosa,
                                        double[] phaseIncrements,
                                        int N)
      • threePDownHillSimplex

        public void threePDownHillSimplex​(double[] optimization,
                                          double[] initialGuess,
                                          double t1,
                                          double tr,
                                          double[] ssfpSampleData,
                                          double[] sina,
                                          double[] cosa,
                                          double[] phaseIncrements,
                                          int N)
      • calculateTwoPResiduals

        public double calculateTwoPResiduals​(double[] simplexLineValues,
                                             double b0,
                                             double t1,
                                             double tr,
                                             double[] Signal,
                                             double[] sina,
                                             double[] cosa,
                                             double[] phaseIncrements,
                                             int N)
      • calculateResiduals

        public double calculateResiduals​(double[] simplexLineValues,
                                         double t1,
                                         double tr,
                                         double[] Signal,
                                         double[] sina,
                                         double[] cosa,
                                         double[] phaseIncrements,
                                         int N)
      • calculate2PResiduals

        public double calculate2PResiduals​(double[] simplexLineValues,
                                           double b0,
                                           double t1,
                                           double tr,
                                           double[] Signal,
                                           double[] sina,
                                           double[] cosa,
                                           double[] phaseIncrements,
                                           int N)
      • calculateBestToWorst

        public void calculateBestToWorst​(double[] simplexResiduals,
                                         int[] bestToWorst,
                                         int numVertices)
      • reduceB0Field

        public void reduceB0Field​(double[][] b0Field,
                                  double resonancePeriod,
                                  int width,
                                  int height)
      • smoothField

        public void smoothField​(double[][] field,
                                float[][] fieldValues,
                                int width,
                                int height,
                                int k)
      • smoothFieldB

        public void smoothFieldB​(double[][] field,
                                 int width,
                                 int height)
      • resetSliceToZero

        public void resetSliceToZero​(double[][] field,
                                     int width,
                                     int height)
      • swapMatrixForVector

        public void swapMatrixForVector​(double[][] fieldField,
                                        float[][] fieldValues,
                                        int k,
                                        int width,
                                        int height)
      • swapMatrixForVectorB

        public void swapMatrixForVectorB​(double[][] fieldField,
                                         float[][] fieldValues,
                                         int k,
                                         int width,
                                         int height)
      • getT2ResultStack

        public ModelImage getT2ResultStack()
      • getM0ResultStack

        public ModelImage getM0ResultStack()
      • getR2ResultStack

        public ModelImage getR2ResultStack()
      • getB0ResultStack

        public ModelImage getB0ResultStack()