Learn R Programming

KATforDCEMRI (version 1.0.1)

KAT.checkData: Checks and converts your data to the RData file format.

Description

Load your data into an R session and save as an RData file that can be analyzed by the KAT function. Also check that dimensions of vectors and arrays are consistent.

Usage

KAT.checkData(file.name, vector.times, map.CC, mask.ROI, vector.AIF, map.tlag=NULL,
write.data.to.file=TRUE)

Arguments

file.name

Give a name to the RData file that will be generated with this function. A .RData extension will automatically be added.

vector.times

The nt x 1 time vector; can have units of seconds or minutes. KAT will automatically assign units based on the following assumptions: units are minutes if \(t_{max}<100\) and seconds if \(t_{max} \ge 100\). Please make sure that these assumptions are consistent with your data. You will have to manually convert the time vector into seconds or minutes prior to running KAT.checkData if the time vector specified by vector.times has other units.

map.CC

The nx x ny x ns x nt contrast agent intensity/concentration array.

mask.ROI

The nx x ny x ns ROI mask array where voxels within the ROI are assigned a 1 and those outside assigned a 0.

vector.AIF

The nt x 1 arterial (vascular) input function.

map.tlag

The nx x ny x ns array that contains per-voxel tag times estimated outside of KAT, to be applied to the vascular input function. Units must be same as those used for vector.times. This argument is optional.

write.data.to.file

Should the original data, loaded into R, be saved in a single RData file for future use? Default=TRUE.

NOTE: if set to FALSE, usage for this function must be exactly as follows:

R> dcemri.data <- KAT.checkData(args)

R> KAT(args)

where the file argument is not specified when calling KAT().

Value

Returns an RData file that can be read by the KAT function.

See Also

KAT, KAT.plot, dcemri.data

Examples

Run this code
# NOT RUN {
## Create temporary directory for benchmark example code output files
temp_dir <- tempdir(check=FALSE)
##
current_dir <- getwd()
setwd(temp_dir)
##
## Run example code
data(dcemri.data, package="KATforDCEMRI")
a1=dcemri.data$vectorTimes
a2=dcemri.data$mapCC
a3=dcemri.data$maskROI
a4=dcemri.data$vectorAIF
KAT.checkData("f",vector.times=a1,map.CC=a2,mask.ROI=a3,vector.AIF=a4,write.data.to.file=TRUE)
##
setwd(current_dir)
# }

Run the code above in your browser using DataLab