make_HRFs {BayesfMRI}R Documentation

Make HRFs

Description

Create HRF design matrix columns from onsets and durations

Usage

make_HRFs(
  onsets,
  TR,
  duration,
  dHRF = c(0, 1, 2),
  dHRF_as = c("auto", "nuisance", "task"),
  downsample = 100,
  verbose = FALSE
)

Arguments

onsets

L-length list in which the name of each element is the name of the corresponding task, and the value of each element is a matrix of onsets (first column) and durations (second column) for each stimuli (each row) of the corresponding task.

TR

Temporal resolution of the data, in seconds.

duration

The number of volumes in the fMRI data.

dHRF

Set to 1 to add the temporal derivative of each column in the design matrix, 2 to add the second derivatives too, or 0 to not add any columns. Default: 1.

dHRF_as

Only applies if dHRF > 0. Model the temporal derivatives as "nuisance" signals to regress out, "tasks", or "auto" to treat them as tasks unless the total number of columns in the design matrix (i.e. the total number of tasks, times dHRF+1), would be >=10, the limit for INLA.

downsample

Downsample factor for convolving stimulus boxcar or stick function with canonical HRF. Default: 100.

verbose

If applicable, print a message saying how the HRF derivatives will be modeled? Default: FALSE.

Value

List with the design matrix and/or the nuisance matrix containing the HRF-convolved stimuli as columns, depending on dHRF_as.

Examples

onsets <- list(taskA=cbind(c(2,17,23),4)) # one task, 3 four sec-long stimuli
TR <- .72 # .72 seconds per volume, or (1/.72) Hz
duration <- 300 # session is 300 volumes long (300*.72 seconds long)
make_HRFs(onsets, TR, duration)


[Package BayesfMRI version 0.3.11 Index]