aslPerfusion.Rd
This function will estimate perfusion from an ASL time series using a (robust) regression approach. It will do motion correction, compcorr, factor out nuisance variables and use regression to estimate the perfusion itself. It will mask the image too based on a simple procedure ( should fix this in the future by allowing the user to optionally pass a mask in from the outside ). WARNING: the function will estimate the m0 image from the mean of the control tags assuming that the data is acquired T C T C as is most of JJ's data. Quantitative CBF can be obtained by mutiplying the output of this function by a scalar.
aslPerfusion(
asl,
maskThresh = 0.75,
moreaccurate = 1,
dorobust = 0.92,
m0 = NA,
skip = 20,
mask = NULL,
checkmeansignal = 100,
moco_results = NULL,
regweights = NULL,
useDenoiser = NULL,
useBayesian = 0,
verbose = FALSE,
ncompcor = 0,
N3 = FALSE
)
input asl image
for estimating a brain mask
zero, one or two with the last being the most accurate
robustness parameter, lower value keeps more data
known M0 if any
stride to speed up robust regression weight estimates
known brain mask
throw out volumes with mean lower than this thresh
passes prior motion results so moco does not get repeated
known temporal weights on regression solution, if any
use the aslDenoiser if this value is a range gt than zero
strength of bayesian prior
bool
number of compcor parameters
bool correct target image before motion corr
output a list of relevant objects
# image available at http://files.figshare.com/1701182/PEDS012_20131101.zip
# fn<-'PEDS012_20131101_pcasl_1.nii.gz'
# asl<-antsImageRead(fn,4)
set.seed(1)
nvox <- 5 * 5 * 5 * 10
dims <- c(5, 5, 5, 10)
asl <- makeImage(dims, rnorm(nvox) + 500) %>% iMath("PadImage", 2)
aslmean <- getAverageOfTimeSeries(asl)
aslmask <- getMask(aslmean, 0.001, Inf)
aslmat <- timeseries2matrix(asl, aslmask)
for (i in 1:10) aslmat[, i * 2] <- aslmat[, i * 2] * 2
asl <- matrix2timeseries(asl, aslmask, aslmat)
# NOT WORKING
if (FALSE) { # \dontrun{
pcasl.processing <- aslPerfusion(asl, moreaccurate = 1, dorobust = 0)
testthat::expect_equal(mean(pcasl.processing$m1), 62.2115522470984)
pcasl.processing <- aslPerfusion(asl, moreaccurate = 1, ncompcor = 2)
# allow some rejection
pcasl.processing <- aslPerfusion(asl, moreaccurate = 1, dorobust = 0.925)
} # }