taskFMRI: Simple taskFMRI function.

View source: R/taskFMRI.R

taskFMRIR Documentation

Simple taskFMRI function.

Description

Input 4D time series matrix. (Perform slice timing correction externally). Estimate hemodynamicRF from block design. Compute brain mask on average bold image. Get nuisance variables : motion , compcor , globalsignal. High-frequency filter the time series ( externally ). Correct for autocorrelation using bullmore 1996 MRM and AR(2) model with parameters derived from global residual signal. Estimate final glm.

Usage

taskFMRI(
  mat,
  hrf,
  myvars,
  correctautocorr = FALSE,
  residualizedesignmatrix = FALSE,
  myformula = NA
)

Arguments

mat

input matrix

hrf

input hrf

myvars

output of getfMRInuisanceVariables

correctautocorr

correction auto correlation boolean

residualizedesignmatrix

boolean

myformula

statistical equation to be assessed at each voxel

Value

list of betas and other names entries is output

Author(s)

Avants BB

Examples

## Not run: 
# read the fmri image in and maybe do slice timing correction
fmri <- getANTsRData("pcasl")
fmri <- antsImageRead(fmri)
#  fmri<-iMath(fmri,"SliceTimingCorrection","bspline") # optional
myvars <- getfMRInuisanceVariables(fmri, moreaccurate = 0, maskThresh = 100)
mat <- myvars$matrixTimeSeries
mat <- frequencyFilterfMRI(mat, 2.5, freqLo = 0.01, freqHi = 0.1, opt = "butt")
blockfing <- c(0, 36, 72)
hrf <- hemodynamicRF(
  scans = dim(fmri)[4], onsets = blockfing,
  durations = rep(12, length(blockfing)), rt = 2.5
)
activationBeta <- taskFMRI(mat, hrf, myvars)

## End(Not run)


stnava/ANTsR documentation built on April 16, 2024, 12:17 a.m.