Class AlgorithmTreT2

All Implemented Interfaces:
ActionListener, WindowListener, Runnable, 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 Details

    • 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
    • t2ResultStack

      private ModelImage t2ResultStack
    • m0ResultStack

      private ModelImage m0ResultStack
    • r2ResultStack

      private ModelImage r2ResultStack
    • b0ResultStack

      private ModelImage b0ResultStack
    • t2ResultWindow

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

      private ViewJFrameImage m0ResultWindow
    • r2ResultWindow

      private ViewJFrameImage r2ResultWindow
    • b0ResultWindow

      private ViewJFrameImage b0ResultWindow
    • ssfpImageNames_phase0

      private String[] ssfpImageNames_phase0
    • ssfpImageNames_phase180

      private String[] ssfpImageNames_phase180
    • t1ImageName

      private String t1ImageName
    • b1ImageName

      private String b1ImageName
    • dialog

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

    • AlgorithmTreT2

      public AlgorithmTreT2(JDialogTreT2 dialog, double[] treFAPhase0, double[] treFAPhase180, String[] ssfpImageNamesPhase0, String[] ssfpImageNamesPhase180, String t1ImageName, 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, String[] wList)
    • AlgorithmTreT2

      public AlgorithmTreT2(ModelImage destImage, ModelImage srcImage, JDialogTreT2 dialog, double[] treFAPhase0, double[] treFAPhase180, String[] ssfpImageNamesPhase0, String[] ssfpImageNamesPhase180, String t1ImageName, 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, String[] wList)
  • Method Details

    • 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()
    • computeProcessors

      protected void computeProcessors()
      Specified by:
      computeProcessors in class AlgorithmTProcess
    • displayImages

      protected void displayImages()
      Specified by:
      displayImages in class AlgorithmTProcess