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 class
AlgorithmTreT1.CalculateT1
private class
AlgorithmTreT1.CalculateT1UsingConventionalTreT1Inner
private class
AlgorithmTreT1.CalculteT1UsingTreT1HIFIInner
-
Nested classes/interfaces inherited from class gov.nih.mipav.model.algorithms.AlgorithmTProcess
AlgorithmTProcess.CalculateT
-
-
Field Summary
Fields Modifier and Type Field Description private double
angleIncrement
private int
b1ImageIndex
private double[][][]
b1ResultData
private ModelImage
b1ResultStack
private ViewJFrameImage
b1ResultWindow
private boolean
calculateM0
private boolean
calculateT1
private boolean
completed
private int[]
direction
private boolean
doubleInversion
private double[]
estimates
private boolean
geScanner
private boolean
invertT1toR1
private double[]
irspgrData
private double
irspgrFA
private int[]
irspgrImageIndex
private double
irspgrKy
private double[]
irspgrTI
private double[]
irspgrTr
private double
irspgrTR
private ModelImage
largestImage
private double[][][]
m0ResultData
private ModelImage
m0ResultStack
private ViewJFrameImage
m0ResultWindow
private double
maxAngle
private double
maxM0
private double
maxT1
private int
Nsa
private int
Nti
private boolean
onefiveTField
private boolean
performStraightTreT1
private boolean
performTreT1HIFI
private boolean
performTreT1withPreCalculatedB1Map
private double
pointScale
private double[][][]
r1ResultData
private ModelImage
r1ResultStack
private ViewJFrameImage
r1ResultWindow
private double[]
residuals
private double
scale
private double
scaleIncrement
private boolean
showB1Map
private boolean
siemensScanner
private boolean
singleInversion
private boolean
smoothB1Field
private double[]
spgrData
private int[]
spgrImageIndex
private double[][][]
t1ResultData
private ModelImage
t1ResultStack
private ViewJFrameImage
t1ResultWindow
The frames for result images (if null at end of algorithm src ModelImage is destroyed)private boolean
threeTField
private java.lang.String[]
titles
private double[]
treFA
private double
treTR
private boolean
uniformAngleSpacing
private boolean
useWeights
private 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 boolean
calculateT1UsingConventionalTreT1()
boolean
calculateT1UsingTreT1HIFI()
protected void
computeProcessors()
protected void
displayImages()
This method is used in both the conventional and HIFI case to display result imagesvoid
finalize()
Prepares this class for destruction.ModelImage
getB1ResultStack()
ModelImage
getM0ResultStack()
ModelImage
getR1ResultStack()
ModelImage
getT1ResultStack()
private void
init()
Initializes local variables that are internal to tre.private void
initializeDisplayImages(ModelImage image)
This method initializes the final images as near-clones of the largest image in the setprivate void
loadFinalData(ModelImage image, double[][][] data)
void
runAlgorithm()
Actually runs the algorithm.double
signalResiduals(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:
computeProcessors
in classAlgorithmTProcess
-
displayImages
protected void displayImages()
This method is used in both the conventional and HIFI case to display result images- Specified by:
displayImages
in classAlgorithmTProcess
-
calculateT1UsingTreT1HIFI
public boolean calculateT1UsingTreT1HIFI()
-
calculateT1UsingConventionalTreT1
public boolean calculateT1UsingConventionalTreT1()
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBase
Actually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithm
in 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)
-
-