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:
java.awt.event.ActionListener,java.awt.event.WindowListener,java.lang.Runnable,java.util.EventListener
public class AlgorithmTreT1 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 T1 calculations given any number of SPGR and IRSPGR images.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classAlgorithmTreT1.CalculateT1private classAlgorithmTreT1.CalculateT1UsingConventionalTreT1Innerprivate classAlgorithmTreT1.CalculteT1UsingTreT1HIFIInner-
Nested classes/interfaces inherited from class gov.nih.mipav.model.algorithms.AlgorithmTProcess
AlgorithmTProcess.CalculateT
-
-
Field Summary
Fields Modifier and Type Field Description private doubleangleIncrementprivate intb1ImageIndexprivate double[][][]b1ResultDataprivate ModelImageb1ResultStackprivate ViewJFrameImageb1ResultWindowprivate booleancalculateM0private booleancalculateT1private booleancompletedprivate int[]directionprivate booleandoubleInversionprivate double[]estimatesprivate booleangeScannerprivate booleaninvertT1toR1private double[]irspgrDataprivate doubleirspgrFAprivate int[]irspgrImageIndexprivate doubleirspgrKyprivate double[]irspgrTIprivate double[]irspgrTrprivate doubleirspgrTRprivate ModelImagelargestImageprivate double[][][]m0ResultDataprivate ModelImagem0ResultStackprivate ViewJFrameImagem0ResultWindowprivate doublemaxAngleprivate doublemaxM0private doublemaxT1private intNsaprivate intNtiprivate booleanonefiveTFieldprivate booleanperformStraightTreT1private booleanperformTreT1HIFIprivate booleanperformTreT1withPreCalculatedB1Mapprivate doublepointScaleprivate double[][][]r1ResultDataprivate ModelImager1ResultStackprivate ViewJFrameImager1ResultWindowprivate double[]residualsprivate doublescaleprivate doublescaleIncrementprivate booleanshowB1Mapprivate booleansiemensScannerprivate booleansingleInversionprivate booleansmoothB1Fieldprivate double[]spgrDataprivate int[]spgrImageIndexprivate double[][][]t1ResultDataprivate ModelImaget1ResultStackprivate ViewJFrameImaget1ResultWindowThe frames for result images (if null at end of algorithm src ModelImage is destroyed)private booleanthreeTFieldprivate java.lang.String[]titlesprivate double[]treFAprivate doubletreTRprivate booleanuniformAngleSpacingprivate booleanuseWeightsprivate java.lang.String[]wList-
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, useSmartThresholding
-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description 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, java.lang.String[] wList, java.lang.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, java.lang.String[] wList, java.lang.String[] titles)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancalculateT1UsingConventionalTreT1()booleancalculateT1UsingTreT1HIFI()protected voidcomputeProcessors()protected voiddisplayImages()This method is used in both the conventional and HIFI case to display result imagesvoidfinalize()Prepares this class for destruction.ModelImagegetB1ResultStack()ModelImagegetM0ResultStack()ModelImagegetR1ResultStack()ModelImagegetT1ResultStack()private voidinit()Initializes local variables that are internal to tre.private voidinitializeDisplayImages(ModelImage image)This method initializes the final images as near-clones of the largest image in the setprivate voidloadFinalData(ModelImage image, double[][][] data)voidrunAlgorithm()Actually 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
cloneFileInfo
-
Methods 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, windowOpened
-
Methods 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, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
t1ResultStack
private ModelImage t1ResultStack
-
m0ResultStack
private ModelImage m0ResultStack
-
r1ResultStack
private ModelImage r1ResultStack
-
b1ResultStack
private ModelImage b1ResultStack
-
t1ResultData
private double[][][] t1ResultData
-
m0ResultData
private double[][][] m0ResultData
-
r1ResultData
private double[][][] r1ResultData
-
b1ResultData
private double[][][] b1ResultData
-
largestImage
private ModelImage 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
private java.lang.String[] wList
-
titles
private java.lang.String[] titles
-
completed
private boolean completed
-
t1ResultWindow
private ViewJFrameImage t1ResultWindow
The frames for result images (if null at end of algorithm src ModelImage is destroyed)
-
m0ResultWindow
private ViewJFrameImage m0ResultWindow
-
r1ResultWindow
private ViewJFrameImage r1ResultWindow
-
b1ResultWindow
private ViewJFrameImage b1ResultWindow
-
-
Constructor Detail
-
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, java.lang.String[] wList, java.lang.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, java.lang.String[] wList, java.lang.String[] titles)
-
-
Method Detail
-
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
public ModelImage getT1ResultStack()
-
getM0ResultStack
public ModelImage getM0ResultStack()
-
getR1ResultStack
public ModelImage getR1ResultStack()
-
getB1ResultStack
public ModelImage getB1ResultStack()
-
initializeDisplayImages
private void initializeDisplayImages(ModelImage image)
This method initializes the final images as near-clones of the largest image in the set- Parameters:
image-
-
loadFinalData
private void loadFinalData(ModelImage image, double[][][] data)
-
-