glmDenoiseR: Optimize a regression model for BOLD based on cross-validated...

Description Usage Arguments Value Author(s) Examples

View source: R/glmDenoiseR.R

Description

Inspired by discussion with Kendrick Kay regarding his glm denoise tool http://journal.frontiersin.org/Journal/10.3389/fnins.2013.00247/abstract 0. estimate hrf using assumed function or finite impulse response (FIR) 1. regressors include: design + trends + noise-pool 2. find noise-pool by initial cross-validation without noise regressors 3. cross-validate predictions using different numbers of noise regressors 4. select best n for predictors from noise pool 5. return the noise mask and the value for n

Usage

1
2
3
4
5
glmDenoiseR(boldmatrix, designmatrixIn, hrfBasis = NA, hrfShifts = 4,
  selectionthresh = 0.1, maxnoisepreds = 1:12, collapsedesign = TRUE,
  debug = FALSE, polydegree = 4, crossvalidationgroups = 4,
  denoisebyrun = TRUE, timevals = NA, runfactor = NA, baseshift = 0,
  noisepoolfun = max, myintercept = 0)

Arguments

boldmatrix

input raw bold data in time by space matrix

hrfBasis

basis function for assumed HRF otherwise use FIR

hrfShifts

n-shifts of assumed hrf - shifts by 1 or, for FIR, length of estimated HRF

designmatrix

input design matrix - binary/impulse entries for event related design, blocks otherwise

Value

returns a list with relevant output

Author(s)

Avants BB

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# get example image
fn<-paste(path.package("RKRNS"),"/extdata/111157_mocoref_masked.nii.gz",sep="")
eximg<-antsImageRead(fn,3)
fn<-paste(path.package("RKRNS"),"/extdata/subaal.nii.gz",sep="")
mask<-antsImageRead(fn,3)
bb<-simulateBOLD(option="henson",eximg=eximg,mask=mask)
boldImage<-bb$simbold
mat<-timeseries2matrix( bb$simbold, bb$mask )
runs<-bb$desmat$Run;
# finite impulse response
hrfbasislength<-20
dd<-glmDenoiseR( mat, bb$desmat[,1:4], hrfBasis=NA, hrfShifts = hrfbasislength,
  crossvalidationgroups=runs, maxnoisepreds=c(0,1,4,6,10,14) , selectionthresh=0.1 ,
  collapsedesign=F, polydegree=4 )
# average of assumed HRFs
tr<-1
a1<-4
a2<-10
hrf<-hemodynamicRF( hrfbasislength, onsets=2,
  durations=tr, rt=tr,cc=0.1,a1=a1,a2=a2,b1=0.9, b2=0.9 )
plot(ts(hrf))
dd2<-glmDenoiseR( mat, bb$desmat[,1:4], hrfBasis=hrf, hrfShifts = 0 ,
  crossvalidationgroups=runs, debug=T,
  maxnoisepreds=4 , selectionthresh=0.1 , collapsedesign=T, polydegree=4 )
# or refine FIR
dd3<-glmDenoiseR( mat, bb$desmat[,1:4], hrfBasis=shift(dd$hrf,-2), hrfShifts = 4 , crossvalidationgroups=runs,
  maxnoisepreds=0:2 , selectionthresh=0.1 , collapsedesign=T, polydegree=4 )

stnava/RKRNS documentation built on Aug. 26, 2017, 9:55 a.m.