Package gov.nih.mipav.model.algorithms
Class AlgorithmTreT2
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.AlgorithmTProcess
gov.nih.mipav.model.algorithms.AlgorithmTreT2
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class gov.nih.mipav.model.algorithms.AlgorithmTProcess
AlgorithmTProcess.CalculateTNested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ModelImageprivate ViewJFrameImageprivate Stringprivate int[]private double[]private final JDialogTreT2The dialog for accessing GUI specific information, also set during scripting.private double[]private booleanprivate ModelImageprivate ViewJFrameImageprivate ModelImageprivate ViewJFrameImageprivate double[]private double[]private double[][]private double[]private double[]private double[]private String[]private String[]private Stringprivate ModelImageprivate ViewJFrameImageThe frames for result images (if null at end of algorithm src ModelImage is destroyed)private final double[]private final double[]private double[]private double[]private double[]private double[]private double[][]private double[]private double[]private double[]Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmTProcess
computeDataThreads, do4D, Gaussian, hardNoiseThreshold, loadDataThreads, lowerLeftCorner, lowerRightCorner, MAX_PROCESS, noiseScale, nSlices, processDataThreads, upperLeftCorner, upperRightCorner, useHardThresholding, useSmartThresholdingFields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmTreT2(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) 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) -
Method Summary
Modifier and TypeMethodDescriptiondoublecalculate2PResiduals(double[] simplexLineValues, double b0, double t1, double tr, double[] Signal, double[] sina, double[] cosa, double[] phaseIncrements, int N) voidcalculateBestToWorst(double[] simplexResiduals, int[] bestToWorst, int numVertices) doublecalculateResiduals(double[] simplexLineValues, double t1, double tr, double[] Signal, double[] sina, double[] cosa, double[] phaseIncrements, int N) voidvoidvoidvoiddoublecalculateTwoPResiduals(double[] simplexLineValues, double b0, double t1, double tr, double[] Signal, double[] sina, double[] cosa, double[] phaseIncrements, int N) protected voidprotected voidvoidfinalize()Prepares this class for destruction.voidreduceB0Field(double[][] b0Field, double resonancePeriod, int width, int height) voidresetSliceToZero(double[][] field, int width, int height) voidActually runs the algorithm.voidsmoothField(double[][] field, float[][] fieldValues, int width, int height, int k) voidsmoothFieldB(double[][] field, int width, int height) voidswapMatrixForVector(double[][] fieldField, float[][] fieldValues, int k, int width, int height) voidswapMatrixForVectorB(double[][] fieldField, float[][] fieldValues, int k, int width, int height) voidthreePDownHillSimplex(double[] optimization, double[] initialGuess, double t1, double tr, double[] ssfpSampleData, double[] sina, double[] cosa, double[] phaseIncrements, int N) voidtwoPDownHillSimplex(double[] optimization, double[] initialGuess, double b0, double t1, double tr, double[] ssfpSampleData, double[] sina, double[] cosa, double[] phaseIncrements, int N) Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmTProcess
cloneFileInfoMethods 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, windowOpenedMethods 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, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
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
-
m0ResultStack
-
r2ResultStack
-
b0ResultStack
-
t2ResultWindow
The frames for result images (if null at end of algorithm src ModelImage is destroyed) -
m0ResultWindow
-
r2ResultWindow
-
b0ResultWindow
-
ssfpImageNames_phase0
-
ssfpImageNames_phase180
-
t1ImageName
-
b1ImageName
-
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:
finalizein classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()Description copied from class:AlgorithmBaseActually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithmin classAlgorithmBase
-
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
-
getM0ResultStack
-
getR2ResultStack
-
getB0ResultStack
-
computeProcessors
protected void computeProcessors()- Specified by:
computeProcessorsin classAlgorithmTProcess
-
displayImages
protected void displayImages()- Specified by:
displayImagesin classAlgorithmTProcess
-