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
)

Arguments

asl

input asl image

maskThresh

for estimating a brain mask

moreaccurate

zero, one or two with the last being the most accurate

dorobust

robustness parameter, lower value keeps more data

m0

known M0 if any

skip

stride to speed up robust regression weight estimates

mask

known brain mask

checkmeansignal

throw out volumes with mean lower than this thresh

moco_results

passes prior motion results so moco does not get repeated

regweights

known temporal weights on regression solution, if any

useDenoiser

use the aslDenoiser if this value is a range gt than zero

useBayesian

strength of bayesian prior

verbose

bool

ncompcor

number of compcor parameters

N3

bool correct target image before motion corr

Value

output a list of relevant objects

Author

Avants BB

Examples


# 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)
} # }