KAT: Kinetic Analysis Tool for DCE-MRI

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/KAT.R

Description

Fits the selected model structure to voxel-wise contrast agent concentration data.

Usage

1
2
3
4
5
6
7
KAT(file = "concatenate.KAT.with.KAT.checkData.RData",
results_file="my_results", method.optimization = "L-BFGS-B",
show.rt.fits = FALSE, param.for.avdt = "Ktrans", range.map = 1.5,
cutoff.map = 0.85, export.matlab = TRUE, export.RData = TRUE,
verbose=FALSE, show.errors = FALSE, try.silent=TRUE, fracGTzero = 0.75,
AIF.shift = "", Force.AIF.peak = FALSE, tlag.Tofts.on = FALSE,
est.per.voxel.tlag = FALSE, ...)

Arguments

file

Specify the file to be analyzed.

results_file

Specify the absolute path to the folder, including file name with no extension (.RData and/or .mat will be automatically added) of the file where results are to be saved.

method.optimization

Optimization method (Nelder-Mead, BFGS, CG, L-BFGS-B, SANN); default=L-BFGS-B.

show.rt.fits

Shows voxel-wise fits as each ROI is processed (default=FALSE).

param.for.avdt

Select extended Tofts model param to display using avdt (Ktrans, kep, ve, vb; default=Ktrans).

range.map

Specifies range of color scale relative to the max value within map (typically a value between 1 and 3; default=1.5).

cutoff.map

Truncate parametric map values by max value * cutoff (typically a value between 0 and 1; default=0.85).

export.matlab

Save results in a matlab file? (default=TRUE). NOTE: matlab files are intended only for use with MATLAB and are not meant to be read back into R for viewing with the advanced voxel diagnosis tool.

export.RData

Save results in an RData file? (default=TRUE).

verbose

Should voxel-wise contrast agent curves and other voxel specific information be printed in the terminal during the parameter estimation process? (default=FALSE).

show.errors

Should errors messages be printed while KAT is running? Default is show.errors = FALSE.

try.silent

Should the silent argument within try functions be TRUE or FALSE? Default is try.silent=TRUE.

fracGTzero

Voxels are excluded from analysis if less than 'fracGTzero' of contrast agent concentrations in a voxel time series are greater than zero. (a value between 0 and 1; default is fracGTzero = 0.75).

AIF.shift

Specify if your vascular input function is based on arterial or venous data. Possible values are "ARTERY" or "VEIN" (or "NONE" if you prefer to not estimate the tlag parameter). This argument must be specified when running KAT.

Force.AIF.peak

Do you want to force the peak values of the shifted Vascular input Function to be equal to the peak value of the original, raw VIF that is read into KAT? The value of this argument is ignored if AIF.shift="NONE". (default=FALSE).

tlag.Tofts.on

Do you want to estimate tlag for the Tofts model (tlag.Tofts.on = TRUE)? If tlag.Tofts.on = FALSE, tlag for the Tofts model will be set equal to the tlag value estimated for the extended Tofts model. If tlag.Tofts.on = TRUE a single tlag value will be estimated based on the median contrast agent profile over the slice of interest. Use with caution, since there may be parameter identifiability issues associated with estimated tlag when fitting the Tofts model to data. (default=FALSE).

est.per.voxel.tlag

Do you want to estimate tlag on a per-voxel basis for the extended Tofts model (est.per.voxel.tlag = TRUE)? Use with caution, since there may be parameter identifiability issues associated with estimated tlag on a per-voxel basis. Note that this argument does not impact per-voxel tlag values within the Tofts model, which will always use tlag values based on median contrast agent profiles. cf. tlag.Tofts.on.

...

Pass arguments to functions within KAT.

Details

Demo

Run the KAT benchmark test by typing

R> demo(KAT, ask=FALSE)

at the R prompt, to analyze the simulated DCE-MRI data set described in dcemri.data.

Model equations [refs. 1-2]

Tofts Model

dCt(t)/dt = Ktrans*VIF(t)-kep*Ct(t)

and

C(t) = Ct(t).

Extended Tofts Model

dCt(t)/dt = Ktrans*VIF(t)-kep*Ct(t)

and

C(t)=v_b*VIF(t)+Ct(t),

where

Ct = tissue/region of interest

and

C(t): measurement model for ROI corresponding to observed CA conc.

VIF(t +/- tlag) represents the Vascular Input Function as VIF(t + tlag) if the measured VIF is based on arterial data or VIF(t - tlag) if the measured VIF is based on venous data.

Objective Function [ref. 3]

The objective function based on maximum likelihood can be written as

OF_M=1/nD*sum(i=1 to nD)[log(1/SDi^2) + (y_i-s(p_hat,ti))^2/(SDi^2)],

where

SDi = standard deviation of each data point i in the intensity/concentration time curve,

yi = data point i in the intensity/concentration time curve,

s(p_hat,ti) = simulated data point at parameter vector p_hat and time point ti,

and

nD = number of data points in the intensity/concentration time curve.

If observed data is unweighted, i.e., SDi=1, OF_M is equal to the mean residual sum of squares, OF_R, or

OF_R = (sum(i=1 to nD)[(y_i-s(p_hat,ti))^2])/ND = RSS/ND = RSSbar.

The objective function implemented in KAT is written as

OF_KAT=RSS=sum(i=1 to nD)[(y_i-s(p_hat,ti))^2].

Model discrimination [ref. 4]

Fits of the Tofts and Extended Tofts model to the intensity/concentration time curve are compared via the Akaike Information Criterion (AIC), written generally as

AIC = -2*log-likelihood + 2*nP.

When applying least squares regression, i.e., OF_KAT, to observed data with Gaussian variability, the AIC is written as

AIC=nD*log(OF_R) + 2*(nP+1).

A correction term for small sample sizes (nD/nP <~ 40) can be derived, yielding

AICc=nD*log(OF_R) + 2*(nP+1) + (2(nP+1)(nP+2))/(nD-nP-2),

where

nP=number of estimated model parameters.

Coefficients of Variation (CVs) for estimated parameters [refs. 5-6]

The Hessian matrix (H(p_hat)) is calculated numerically by R during the parameter estimation process, so that the covariance matrix (cov) and %CVs for model parameters estimated using the OF_KAT, i.e., RSS, objective function may be approximated as

cov(p_hat)=(nP*OF_KAT)/(nD-nP)*H^-1(p_hat)

and

%CV(p_hat)=sqrt(diag[cov(p_hat)])/(p_hat) * 100%,

where diag[cov(p_hat)] is a vector composed of the diagonal elements of cov and p_hat is the vector of final parameter estimates. Note that this method for calculating %CVs assumes that variability in measured data points follows a Gaussian distribution. Thus, large outlier data points in the concentration/intensity curve, for example those caused by patient motion, may inflate estimated %CVs.

Contents of output file

args: List of all arguments specified when running the KAT function plus a few additional values generated during the run.

cc: nx x ny x nt array of voxel-wise contrast agent concentration/intensity-time curves for all voxels within the Field of View.

ccroi: nx x ny x nt array of voxel-wise contrast agent concentration/intensity-time curves for all voxels within the Region of Interest.

ccmedian: Median contrast agent-time profile within the Region of Interest.

maptimes: nt x 1 time vector.

aif: nt x 1 Vascular Input Function.

aifshifted: nt x 1 Time shifted (by tlag) Vascular Input Function.

maskroi: nx x ny array indicating the region of interest.

mapKtransxT: nx x ny array of Ktrans values estimated using the extended Tofts model.

mapKtransxTcv: nx x ny array of %CVs associated with Ktrans values in mapKtransxT.

mapkepxT: nx x ny array of kep values estimated using the extended Tofts model.

mapkepxTcv: nx x ny array of %CVs associated with kep values in mapkepxT.

mapvbxT: nx x ny array of vb values estimated using the extended Tofts model.

mapvbxTcv: nx x ny array of %CVs associated with vb values in mapvbxT.

mapvexT: nx x ny array of ve values estimated using the extended Tofts model. Note that ve is not directly fitted to the concentration/intensity data but is calculated as ve=Ktrans/kep

mapOptimValuexT: nx x ny array of objective function values for voxels where the extended Tofts model has successfully converged (convergence/exit code=0; see ?optim).

mapfitfailuresxT: Map indicating per voxel optimization exit codes for the extended Tofts model. 0: indicates successful completion. 1: indicates that the iteration limit maxit had been reached. 10: indicates degeneracy of the Nelder-Mead simplex. 51: indicates a warning from the L-BFGS-B method; see component message for further details. 52: indicates an error from the L-BFGS-B method; see component message for further details. 99: indicates a try error (optimization routine crashed). -2: indicates that voxel failed fracGTzero test. Voxels with exit codes > 0 will appear white when using the interactive AVDT and are excluded from subsequent analysis.

paramestmedianxT: List of median values of all extended Tofts model parameters fitted on a voxel-wise basis to contrast agent curves within the ROI; includes the percent of total fitted voxels that are classified as fit failures.

roimedianfittedxTofts: Simulated contrast agent-time profile generated by fitting the extended Tofts model to median contrast agent values within the Region of Interest.

paramestwholeroixTofts: Model parameters estimated by fitting the extended Tofts model to median concentration/intensity data across the Region of Interest. These parameters are used to generate roimedianfittedxTofts.

cvwholeroixTofts: %CVs for extended Tofts model parameters listed in paramestwholeroixTofts.

mapKtransT: nx x ny array of Ktrans values estimated using the Tofts model.

mapKtransTcv: nx x ny array of %CVs associated with Ktrans values in mapKtransT.

mapkepT: nx x ny array of kep values estimated using the Tofts model.

mapkepTcv: nx x ny array of %CVs associated with kep values in mapkepT.

mapveT: nx x ny array of ve values estimated using the Tofts model. Note that ve is not directly fitted to the concentration/intensity data but is calculated as ve=Ktrans/kep.

mapOptimValueT: nx x ny array of objective function values for voxels where the Tofts model has successfully converged (convergence/exit code=0; see ?optim).

mapfitfailuresT: Map indicating per voxel optimization exit codes for the Tofts model. 0: indicates successful completion. 1: indicates that the iteration limit maxit had been reached. 10: indicates degeneracy of the Nelder-Mead simplex. 51: indicates a warning from the L-BFGS-B method; see component message for further details. 52: indicates an error from the L-BFGS-B method; see component message for further details. 99: indicates a try error (optimization routine crashed). -2: indicates that voxel failed fracGTzero test. Voxels with exit codes > 0 will appear white when using the interactive AVDT and are excluded from subsequent analysis.

paramestmedianT: List of median values of all Tofts model parameters fitted on a voxel-wise basis to contrast agent curves within the ROI; includes the percent of total fitted voxels that are classified as fit failures.

roimedianfittedTofts: Simulated contrast agent-time profile generated by fitting the Tofts model to median contrast agent values within the Region of Interest.

paramestwholeroiTofts: Model parameters estimated by fitting the Tofts model to median concentration/intensity data across the Region of Interest. These parameters are used to generate roimedianfittedTofts.

proctimetotal: Total processing time in minutes.

roiplotparams: Cropping coordinates applied to the FOV and upper limit of color bar for visualization of parametric maps via the advanced voxel diagnostic tool (AVDT).

KATversion: Version of KATforDCEMRI used to generate this output file.

mapAICxT: nx x ny array of AICc values for per-voxel fits of the extended Tofts model to concentration/intensity data.

mapAICT: nx x ny array of AICc values for per-voxel fits of the Tofts model to concentration/intensity data.

mapAICcompare: nx x ny nx x ny array that contains a “1” for voxels with a lower (lower=better model) AIC for the extended Tofts model or a “2” for voxels with a lower AIC for the Tofts model.

nx: x dimension of the FOV.

ny: y dimension of the FOV.

nt: number of elements in the time vector (number of time points).

ccFittedxT: nx x ny x nt array of extended Tofts model simulations fitted to voxel-wise contrast agent concentration-time data within the ROI.

ccFittedT: nx x ny x nt array of Tofts model simulations fitted to voxel-wise contrast agent concentration-time data within the ROI.

p0T: Initial parameter values for the Tofts model where Ktrans(0) and kep(0) are estimated using the numerical deconvolution method described in the DATforDCEMRI package refs [refs 7-8].

p0xT: Initial values for the extended Tofts model where Ktrans(0) and kep(0) are the same as those used for p0T. Initial values for vb and tlag are set to nominal values (0.05 and 7.2 seconds), when fitting the model to median data. Initial values for vb and tlag, when fitting the xTofts model to per-voxel data, are set to those values estimated based on fits to the median data.

IRFresults: Contains results of noncompartmental analysis of the estimated Impulse Response Function (IRF), where AUC is the area under the curve (AUC) of the IRF and is analogous to the Tofts parameter ve, AUCMRT is the AUC of the IRF divided by the Mean Residence Time (MRT) of the IRF and is analogous to the Tofts parameter Ktrans and AUCMRT.divby.AUC is AUCMRT divided by AUC (equal to 1/MRT) and is analogous to the Tofts parameter kep. Each of these parameters is either corrected for truncation error and contribution of v_b using nominal values (corrnom), as described in the entry for p0xT, or the actual values estimated based on fitting the extended Tofts model to median intensity/concentration data (corr). The method for truncation correction is described in [ref 7].

mapEF: Map indicating enhancing voxel within the specified region of interest, where a “1” indicates enhancement.

Author(s)

Gregory Z. Ferl

References

Model equations

[1] Tofts P, Kermode A (1991) doi: 10.1002/mrm.1910170208

[2] Tofts et al. (1999) https://www.ncbi.nlm.nih.gov/pubmed/10508281

[3] Ferl GZ, Port RE (2012) doi: 10.1038/clpt.2012.63

Objective Function

[4] Barrett PHR, Bell BM, Cobelli C, Golde H, Schumitzky A, Vicini P, and Foster DM (1998) doi: 10.1016/S0026-0495(98)90064-6

Model discrimination

[5] Glatting G, Kletting P, Reske SN (2007). doi: 10.1118/1.2794176

Coefficients of Variation (CVs) for estimated parameters

[6] Venables WN, Smith DM, R Core Team (2012) https://CRAN.R-project.org/doc/manuals/R-intro.pdf

R package for numerical deconvolution

[7] Ferl GZ, Xu L, Friesenhahn M, Bernstein LJ, Barboriak DP, Port RE (2010) doi: 10.1002/mrm.22335

[8] Ferl GZ (2011) doi: 10.18637/jss.v044.i03

See Also

KAT.checkData, KAT.plot, dcemri.data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
## Create temporary directory for example code output files
temp_dir <- tempdir(check=FALSE)
##
current_dir <- getwd()
setwd(temp_dir)
##
## Run example code
demo(KAT, ask=FALSE)
##
setwd(current_dir)
##
## ANALYZE DATA FROM A SINGLE DCE-MRI SCAN
##
## Load MATLAB files into R
## R> aif <- readMat("mydatafile-AIF.mat")$aif
## R> ct <- readMat("mydatafile-CT.mat")$ct
## R> roi <- readMat("mydatafile-ROILES.mat")$roi
## R> tvec <- readMat("mydatafile-TVEC.mat")$tvec
##
## Check that the dimensionality of the loaded data is consistent and save
## as a single R object or RData file
## R> dcemri.data <- KAT.checkData(file.name="mydatafile", vector.times=tvec,
##    map.CC=ct, mask.ROI=roi, vector.AIF=aif)
##
## Fit the Tofts and extended Tofts model to all ROIs in RData file
## R> KAT(file="mydatafile.RData", results_file= "mydatafile_out",
## show.rt.fits=TRUE, AIFshift="VEIN")
##
## Plot all ROIs in a single figure
## R> KAT.plot(F1="mydatafile_out_slice3.RData",
##    F2="mydatafile_out_slice4.RData", F3="mydatafile_out_slice5.RData",
##    F4="mydatafile_out_slice6.RData")
##
## Visualize and explore a parametric map for a single ROI
## R> KAT(file="mydatafile_out_slice6.RData")

KATforDCEMRI documentation built on Aug. 26, 2019, 9:03 a.m.