Package gov.nih.mipav.model.algorithms
Class AlgorithmSM2
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmSM2
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmSM2 extends AlgorithmBase
Based on the document provided by Daniel Reich: Notes on DCE with SM2 (standard model, aka Tofts model, 2-compartment) 3 model parameters are fit for each voxel in 3D: 1) K_trans in [1.0E-5, 5.0] in /min On input ktrans is converted from /min to /sec and on output ktrans is converted from /sec to /min. 2) ve in [1.0E-5, 0.99] 3) f_vp in [0, 0.99] srcImage is a dynamic "4D volume" of MRI signal (3D over time). The equation used here is virtually identical to equation 10.3 in T1-w DCE-MRI. Ct(t) = vpCp(t) + ktrans*integral from 0 to t of Cp(t') * exp[-ktrans*(t - t')/ve]dt' (10.3) Cp is the concentration of agent in the vascular plasma space, vp. ve is the volume of the extravascular extracellular space per unit volume of tissue. ktrans is the volume transfer constant between vp and ve. Ct is the tracer concentration in the tissue as a whole. Our equation is: R1(t) - R10 = (vp * [R1,p(t) - R10,p] + ktrans*integral from 0 to t of [R1,p(tau) - R10,p]*exp[-ktrans*(t - tau)/ve]d(tau))/(1 - h) where R10 is the tissue R1 map in the absence of contrast material, a 3D volume R1(tj) is the tissue R1 map during contrast infusion, a 4D data set. h = hematocrit with a default value of 0.4. With the sagittal sinus VOI: Average over this VOI to extract the constant R10,p from the R10 map. Average over this VOI to extract the time series R1,p(tj) from the R1(tj) 4D data set. tj is a vector of the center times for each volume, where j = 1,...,n and n is the number of post-contrast volumes. Solve the equation numerically assuming piecewise linearity and using the trapezoid rule. The pre-injection volumes are actually averaged together to generate the R10 map. So you're right, they wouldn't provide any additional information, and we don't need to fit them. After injection (t=t1), the first volume usually has no contrast in it. That's because the contrast has to circulate to the brain. So R1,p(t1) should be the same as R10,p, but in our scheme R1,p(t1) wasn't used to generate the R10 map. Any differences should be due to noise. Does that help explain things? For monomeric gadolinium chelates, Ktrans for the normal blood brain barrier is approximately 10^-4 min^-1 (from the legend to Fig 5 of Li, Rooney, and Springer (MRM, 2005)). So a lower bound of 10^-5 should be ok. If R1,p(t1) = R10,p except for noise, then R1,p(t1) - R10,p is purely noise and contains no useful information References: 1.) "A Unified Magnetic Resonance Imaging Pharmacokinetic Theory: Intravascular and Extracellular Contrast Reagents" by Xin Li, William D. Rooney, and Charles S. Springer, Jr., Magnetic Resonance in Medicine, Vol. 54, 2005, pp. 1351-1359. 2.) Erratum: Magnetic Resonance in Medicine, Vol. 55, 2006, p.1217. 3.) Quantitative MRI of the Brain, Edited by Paul Tofts, 2003, John Wiley & Sons, Ltd., ISBN: 0-47084721-2, Chapter 10, T1-w DCE-MRI: T1-weighted Dynamic Contrast-enhanced MRI by Geoff J. M. Parker and Anwar R. Padhani, pp. 341-364. 4.) Larsson HBW, Courivaud F, Rostrup E, Hansen AE. Measurement of brain perfusion, blood volume, and blood-brain barrier permeability, using dynamic contrast-enhanced T1-weighted MRI at 3 tesla. Magnetic Resonance in Medicine 2009; 62(5):1270-1281. 5.) Li X, Rooney WD, Springer CS. A unified magnetic resonance imaging pharmacokinetic theory: intravascular and extracellular contrast reagents. Magnetic Resonance in Medicine 2005 Dec; 54(6): 1351-1359. 6.) Tofts PS, Modeling tracer kinetics in dynamic Gd-DPTA MR imaging. Journal of Magnetic Resonance Imaging, 1997, 7(1), pp. 91-101. 7.) Tofts PS, Brix G, Buckley DL, Evelhoch JL, Henderson E, Knopp MV, Larsson HB, Mayr NA, Parker GJ, Port RE, Taylor J, Weisskoff RM. Estimating kinetic parameters from dynamic contrast-enhanced T(1)-weighted MRI of a diffusable tracer: standardized quantitites and symbols. J. Magn. Reson Imaging 1999 Sep; 10(3), pp. 223-232.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
AlgorithmSM2.FitAll
(package private) class
AlgorithmSM2.FitAllEP
(package private) class
AlgorithmSM2.FitAllNL2
(package private) class
AlgorithmSM2.FitSM2ConstrainedModel
(package private) class
AlgorithmSM2.FitSM2ConstrainedModelC
(package private) class
AlgorithmSM2.FitSM2nl2solModel
(package private) class
AlgorithmSM2.Integration2All
(package private) class
AlgorithmSM2.Integration2EPAll
(package private) class
AlgorithmSM2.IntModel
class
AlgorithmSM2.sm2Task
-
Field Summary
Fields Modifier and Type Field Description private int
barMarker
private java.util.BitSet
bitMask
private float[][]
destArray
private int[]
destExitStatusArray
private ModelImage[]
destImage
private int
elsuncEngine
private int[]
exitStatus
private double[][]
exparray
private int
fittingEngine
private double
h
private int
i
private double[]
initial
private double
ktransDivVe
private double
ktransTotal
private double[]
max_constr
private double[]
min_constr
private int
nl2solEngine
private int
oldBarMarker
private int[]
paramInf
private double[]
paramMax
private double[]
paramMin
private int[]
paramNaN
private int
processors
private int
processRegionIndex
private double
r1pt0
private double[]
r1ptj
private double[]
r1t0
private double[]
r1tj
private int
sagittalSinusIndex
private int
tDim
private double[]
timeVals
A vector of center times for each volumeprivate ModelImage
tissueImage
private double[]
trapezoidConstant
private double[]
trapezoidMidpoint
private double[]
trapezoidSlope
private int
validVoxels
private double
veTotal
private int
volSize
private long
voxelsProcessed
private double
vpTotal
private boolean
wholeImage
private int
xDim
private int
yDim
private double[]
ymodel
private int
zDim
-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmSM2(ModelImage[] destImage, ModelImage srcImage, double[] min_constr, double[] max_constr, double[] initial, ModelImage tissueImage, double[] timeVals, double h, int sagittalSinusIndex, int processRegionIndex)
Creates a new AlgorithmDEMRI3 object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalize()
Prepares this class for destruction.void
input(double[] y_array, int i)
void
output(double[] params, double paramSecs0, int i, int exitBits, float chi_squared)
void
runAlgorithm()
starts the algorithm.private void
statusMessage(int status)
private void
statusMessageNL2sol(int status, int numParam)
-
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
-
destImage
private ModelImage[] destImage
-
timeVals
private double[] timeVals
A vector of center times for each volume
-
r1t0
private double[] r1t0
-
r1tj
private double[] r1tj
-
r1pt0
private double r1pt0
-
r1ptj
private double[] r1ptj
-
min_constr
private double[] min_constr
-
max_constr
private double[] max_constr
-
h
private final double h
-
sagittalSinusIndex
private final int sagittalSinusIndex
-
processRegionIndex
private int processRegionIndex
-
ymodel
private double[] ymodel
-
i
private int i
-
xDim
private int xDim
-
yDim
private int yDim
-
zDim
private int zDim
-
tDim
private int tDim
-
volSize
private int volSize
-
initial
private double[] initial
-
trapezoidMidpoint
private double[] trapezoidMidpoint
-
trapezoidConstant
private double[] trapezoidConstant
-
trapezoidSlope
private double[] trapezoidSlope
-
ktransDivVe
private double ktransDivVe
-
exparray
private double[][] exparray
-
exitStatus
private int[] exitStatus
-
paramNaN
private final int[] paramNaN
-
paramInf
private final int[] paramInf
-
paramMin
private final double[] paramMin
-
paramMax
private final double[] paramMax
-
processors
private int processors
-
destArray
private float[][] destArray
-
destExitStatusArray
private int[] destExitStatusArray
-
voxelsProcessed
private long voxelsProcessed
-
barMarker
private int barMarker
-
oldBarMarker
private int oldBarMarker
-
tissueImage
private ModelImage tissueImage
-
bitMask
private java.util.BitSet bitMask
-
validVoxels
private int validVoxels
-
ktransTotal
private double ktransTotal
-
veTotal
private double veTotal
-
vpTotal
private double vpTotal
-
wholeImage
private boolean wholeImage
-
elsuncEngine
private final int elsuncEngine
- See Also:
- Constant Field Values
-
nl2solEngine
private final int nl2solEngine
- See Also:
- Constant Field Values
-
fittingEngine
private final int fittingEngine
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AlgorithmSM2
public AlgorithmSM2(ModelImage[] destImage, ModelImage srcImage, double[] min_constr, double[] max_constr, double[] initial, ModelImage tissueImage, double[] timeVals, double h, int sagittalSinusIndex, int processRegionIndex)
Creates a new AlgorithmDEMRI3 object.
-
-
Method Detail
-
finalize
public void finalize()
Prepares this class for destruction.- Overrides:
finalize
in classAlgorithmBase
-
runAlgorithm
public void runAlgorithm()
starts the algorithm.- Specified by:
runAlgorithm
in classAlgorithmBase
-
statusMessage
private void statusMessage(int status)
-
statusMessageNL2sol
private void statusMessageNL2sol(int status, int numParam)
-
input
public void input(double[] y_array, int i)
-
output
public void output(double[] params, double paramSecs0, int i, int exitBits, float chi_squared)
-
-