Learn R Programming

ANTsR (version 0.3.1)

aslDenoiseR: WIP: data-driven denoising for ASL MRI

Description

Denoises regression based reconstruction of CBF from arterial spin labeling

Usage

aslDenoiseR(boldmatrix, targety, motionparams = NA, selectionthresh = 0.1,
  maxnoisepreds = 1:12, debug = FALSE, polydegree = 4,
  crossvalidationgroups = 4, scalemat = F, noisepoolfun = max,
  usecompcor = F)

Arguments

boldmatrix

input bold matrix

targety

target to predict

motionparams

motion parameters / nuisance variables

selectionthresh

e.g. 0.1 take 10 percent worst variables for noise estimation

maxnoisepreds

integer search range e.g 1:10

debug

boolean

polydegree

eg 4 for polynomial nuisance variables

crossvalidationgroups

prior defined or integer valued

scalemat

boolean

noisepoolfun

function to help select noise pool e.g. max

usecompcor

boolean

Value

matrix is output

Examples

Run this code
# NOT RUN {
# asl<-antsImageRead( getANTsRData("pcasl") )
set.seed(1)
nvox <- 10*10*10*20
dims <- c(10,10,10,20)
asl <- makeImage( dims , rnorm( nvox )+500 )
aslmean <- getAverageOfTimeSeries( asl )
aslmask <- getMask( aslmean  )
aslmat<-timeseries2matrix( asl, aslmask )
for ( i in 1:10 ) aslmat[,i*2]<-aslmat[,i*2]*2
asl<-matrix2timeseries( asl, aslmask, aslmat )
tc<-as.factor(rep(c("C","T"),nrow(aslmat)/2))
dv<-computeDVARS(aslmat)
dnz<-aslDenoiseR( aslmat, tc, motionparams=dv, selectionthresh=0.1,
  maxnoisepreds=c(1:2), debug=TRUE, polydegree=2, crossvalidationgroups=2 )
# }
# NOT RUN {
# a classic regression approach to estimating perfusion
# not recommended, but shows the basic idea.
# see ?quantifyCBF for a better approach
perfmodel<-lm( aslmat ~ tc + dnz$noiseu  )
perfimg<-antsImageClone(aslmask)
perfimg[ aslmask == 1 ]<-bigLMStats( perfmodel )$beta[1,]
m0<-getAverageOfTimeSeries(asl)
ctl<-c(1:(nrow(aslmat)/2))*2
m0[ aslmask==1 ]<-colMeans(aslmat[ctl,])
pcasl.parameters<-list( sequence="pcasl", m0=m0 )
cbf <- quantifyCBF( perfimg, aslmask, pcasl.parameters )
# }

Run the code above in your browser using DataLab