Description Usage Arguments Value Author(s) Examples
View source: R/getASLNoisePredictors.R
Get nuisance predictors from ASL images
1 2 3 4 5 6 7 8 9 10 11 | getASLNoisePredictors(
aslmat,
tc,
noisefrac = 0.1,
polydegree = "loess",
k = 5,
npreds = 12,
method = "noisepool",
covariates = NA,
noisepoolfun = max
)
|
aslmat |
ASL input matrix. |
tc |
Tag-control sawtooth pattern vector. |
noisefrac |
Fraction of data to include in noise pool. |
polydegree |
Degree of polynomial for detrending, with a value of 0
indicating no detrending, or |
k |
Number of cross-validation folds. |
npreds |
Number of predictors to output. |
method |
Method of selecting noisy voxels. One of 'compcor' or
'noisepool'. See |
covariates |
Covariates to be considered when assessing prediction of tc pattern. |
noisepoolfun |
Function used for aggregating R^2 values. |
Matrix of size nrow(aslmat)
by npreds
, containing a
timeseries of all the nuisance predictors.
Brian B. Avants, Benjamin M. Kandel
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # for real data do img<-antsImageRead(getANTsRData("pcasl"),4)
set.seed(120)
img<-makeImage( c(10,10,10,20), rnorm(1000*20)+1 )
mask = getMask( getAverageOfTimeSeries( img ) )
aslmat <- timeseries2matrix( img, mask )
tc <- rep(c(0.5, -0.5), length.out=nrow(aslmat))
noise <- getASLNoisePredictors(aslmat, tc, k=2, npreds=2, noisefrac=0.5 )
cm = colMeans(noise)
rounding_type = RNGkind()[3]
if (getRversion() < "3.6.0" || rounding_type == "Rounding") {
testthat::expect_equal(cm, c(-0.223292128499263, 0.00434481670243642), tolerance = .01 )
} else {
testthat::expect_equal(cm, c(-0.223377249912075, 0.0012754214030999), tolerance = .01)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.