Package gov.nih.mipav.model.algorithms
Class AlgorithmTreT1
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.AlgorithmTProcess
gov.nih.mipav.model.algorithms.AlgorithmTreT1
- 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 T1 calculations given any number of
SPGR and IRSPGR images.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate classprivate classNested 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 doubleprivate intprivate double[][][]private ModelImageprivate ViewJFrameImageprivate booleanprivate booleanprivate booleanprivate int[]private booleanprivate double[]private booleanprivate booleanprivate double[]private doubleprivate int[]private doubleprivate double[]private double[]private doubleprivate ModelImageprivate double[][][]private ModelImageprivate ViewJFrameImageprivate doubleprivate doubleprivate doubleprivate intprivate intprivate booleanprivate booleanprivate booleanprivate booleanprivate doubleprivate double[][][]private ModelImageprivate ViewJFrameImageprivate double[]private doubleprivate doubleprivate booleanprivate booleanprivate booleanprivate booleanprivate double[]private int[]private double[][][]private ModelImageprivate ViewJFrameImageThe frames for result images (if null at end of algorithm src ModelImage is destroyed)private booleanprivate String[]private double[]private doubleprivate booleanprivate booleanprivate String[]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
ConstructorsConstructorDescriptionAlgorithmTreT1(double treTR, double irspgrTR, double irspgrKy, double irspgrFA, double maxT1, double maxM0, double[] treFA, double[] irspgrTr2, double[] irspgrTI, double[] spgrData, double[] irspgrData, double scale, double pointScale, double scaleIncrement, double[] estimates, double[] residuals, int[] direction, int[] spgrImageIndex, int[] irspgrImageIndex, int b1ImageIndex, double angleIncrement, int nsa, int nti, double maxAngle, boolean smoothB1Field, boolean performStraightTreT1, boolean performTreT1withPreCalculatedB1Map, boolean performTreT1HIFI, boolean doubleInversion, boolean singleInversion, boolean geScanner, boolean siemensScanner, boolean threeTField, boolean onefiveTField, boolean calculateT1, boolean showB1Map, boolean calculateM0, boolean invertT1toR1, boolean useWeights, boolean uniformAngleSpacing, boolean upperLeftCorner, boolean upperRightCorner, boolean lowerLeftCorner, boolean lowerRightCorner, boolean useSmartThresholding, boolean useHardThresholding, float noiseScale, float hardNoiseThreshold, String[] wList, String[] titles) AlgorithmTreT1(ModelImage destImage, ModelImage srcImage, double treTR, double irspgrTR, double irspgrKy, double irspgrFA, double maxT1, double maxM0, double[] treFA, double[] irspgrTr2, double[] irspgrTI, double[] spgrData, double[] irspgrData, double scale, double pointScale, double scaleIncrement, double[] estimates, double[] residuals, int[] direction, int[] spgrImageIndex, int[] irspgrImageIndex, int b1ImageIndex, double angleIncrement, int nsa, int nti, double maxAngle, boolean smoothB1Field, boolean performStraightTreT1, boolean performTreT1withPreCalculatedB1Map, boolean performTreT1HIFI, boolean doubleInversion, boolean singleInversion, boolean geScanner, boolean siemensScanner, boolean threeTField, boolean onefiveTField, boolean calculateT1, boolean showB1Map, boolean calculateM0, boolean invertT1toR1, boolean useWeights, boolean uniformAngleSpacing, boolean upperLeftCorner, boolean upperRightCorner, boolean lowerLeftCorner, boolean lowerRightCorner, boolean useSmartThresholding, boolean useHardThresholding, float noiseScale, float hardNoiseThreshold, String[] wList, String[] titles) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanprotected voidprotected voidThis method is used in both the conventional and HIFI case to display result imagesvoidfinalize()Prepares this class for destruction.private voidinit()Initializes local variables that are internal to tre.private voidThis method initializes the final images as near-clones of the largest image in the setprivate voidloadFinalData(ModelImage image, double[][][] data) voidActually runs the algorithm.doublesignalResiduals(double x, double[] spgrData, double[] irspgrData, double Inversion, int Nfa, int Nti, double[] treFA, double treTR, double[] irspgrTr, double[] irspgrTI, double irspgrFA) 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
-
t1ResultStack
-
m0ResultStack
-
r1ResultStack
-
b1ResultStack
-
t1ResultData
private double[][][] t1ResultData -
m0ResultData
private double[][][] m0ResultData -
r1ResultData
private double[][][] r1ResultData -
b1ResultData
private double[][][] b1ResultData -
largestImage
-
treTR
private double treTR -
irspgrTR
private double irspgrTR -
irspgrKy
private double irspgrKy -
irspgrFA
private double irspgrFA -
maxT1
private double maxT1 -
maxM0
private double maxM0 -
treFA
private double[] treFA -
irspgrTr
private double[] irspgrTr -
irspgrTI
private double[] irspgrTI -
spgrData
private double[] spgrData -
irspgrData
private double[] irspgrData -
scale
private double scale -
pointScale
private double pointScale -
scaleIncrement
private double scaleIncrement -
estimates
private double[] estimates -
residuals
private double[] residuals -
direction
private int[] direction -
spgrImageIndex
private int[] spgrImageIndex -
irspgrImageIndex
private int[] irspgrImageIndex -
b1ImageIndex
private int b1ImageIndex -
angleIncrement
private double angleIncrement -
Nsa
private int Nsa -
Nti
private int Nti -
maxAngle
private double maxAngle -
smoothB1Field
private boolean smoothB1Field -
performStraightTreT1
private boolean performStraightTreT1 -
performTreT1withPreCalculatedB1Map
private boolean performTreT1withPreCalculatedB1Map -
performTreT1HIFI
private boolean performTreT1HIFI -
doubleInversion
private boolean doubleInversion -
singleInversion
private boolean singleInversion -
geScanner
private boolean geScanner -
siemensScanner
private boolean siemensScanner -
threeTField
private boolean threeTField -
onefiveTField
private boolean onefiveTField -
calculateT1
private boolean calculateT1 -
showB1Map
private boolean showB1Map -
calculateM0
private boolean calculateM0 -
invertT1toR1
private boolean invertT1toR1 -
useWeights
private boolean useWeights -
uniformAngleSpacing
private boolean uniformAngleSpacing -
wList
-
titles
-
completed
private boolean completed -
t1ResultWindow
The frames for result images (if null at end of algorithm src ModelImage is destroyed) -
m0ResultWindow
-
r1ResultWindow
-
b1ResultWindow
-
-
Constructor Details
-
AlgorithmTreT1
public AlgorithmTreT1(double treTR, double irspgrTR, double irspgrKy, double irspgrFA, double maxT1, double maxM0, double[] treFA, double[] irspgrTr2, double[] irspgrTI, double[] spgrData, double[] irspgrData, double scale, double pointScale, double scaleIncrement, double[] estimates, double[] residuals, int[] direction, int[] spgrImageIndex, int[] irspgrImageIndex, int b1ImageIndex, double angleIncrement, int nsa, int nti, double maxAngle, boolean smoothB1Field, boolean performStraightTreT1, boolean performTreT1withPreCalculatedB1Map, boolean performTreT1HIFI, boolean doubleInversion, boolean singleInversion, boolean geScanner, boolean siemensScanner, boolean threeTField, boolean onefiveTField, boolean calculateT1, boolean showB1Map, boolean calculateM0, boolean invertT1toR1, boolean useWeights, boolean uniformAngleSpacing, boolean upperLeftCorner, boolean upperRightCorner, boolean lowerLeftCorner, boolean lowerRightCorner, boolean useSmartThresholding, boolean useHardThresholding, float noiseScale, float hardNoiseThreshold, String[] wList, String[] titles) -
AlgorithmTreT1
public AlgorithmTreT1(ModelImage destImage, ModelImage srcImage, double treTR, double irspgrTR, double irspgrKy, double irspgrFA, double maxT1, double maxM0, double[] treFA, double[] irspgrTr2, double[] irspgrTI, double[] spgrData, double[] irspgrData, double scale, double pointScale, double scaleIncrement, double[] estimates, double[] residuals, int[] direction, int[] spgrImageIndex, int[] irspgrImageIndex, int b1ImageIndex, double angleIncrement, int nsa, int nti, double maxAngle, boolean smoothB1Field, boolean performStraightTreT1, boolean performTreT1withPreCalculatedB1Map, boolean performTreT1HIFI, boolean doubleInversion, boolean singleInversion, boolean geScanner, boolean siemensScanner, boolean threeTField, boolean onefiveTField, boolean calculateT1, boolean showB1Map, boolean calculateM0, boolean invertT1toR1, boolean useWeights, boolean uniformAngleSpacing, boolean upperLeftCorner, boolean upperRightCorner, boolean lowerLeftCorner, boolean lowerRightCorner, boolean useSmartThresholding, boolean useHardThresholding, float noiseScale, float hardNoiseThreshold, String[] wList, String[] titles)
-
-
Method Details
-
init
private void init()Initializes local variables that are internal to tre. -
computeProcessors
protected void computeProcessors()- Specified by:
computeProcessorsin classAlgorithmTProcess
-
displayImages
protected void displayImages()This method is used in both the conventional and HIFI case to display result images- Specified by:
displayImagesin classAlgorithmTProcess
-
calculateT1UsingTreT1HIFI
public boolean calculateT1UsingTreT1HIFI() -
calculateT1UsingConventionalTreT1
public boolean calculateT1UsingConventionalTreT1() -
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
-
signalResiduals
public double signalResiduals(double x, double[] spgrData, double[] irspgrData, double Inversion, int Nfa, int Nti, double[] treFA, double treTR, double[] irspgrTr, double[] irspgrTI, double irspgrFA) -
getT1ResultStack
-
getM0ResultStack
-
getR1ResultStack
-
getB1ResultStack
-
initializeDisplayImages
This method initializes the final images as near-clones of the largest image in the set- Parameters:
image-
-
loadFinalData
-