Create the expected BOLD response for a given task indicator function.
fmri.stimulus(scans =1, onsets = c(1), durations = c(1), TR =2, times =FALSE, sliceorder =NULL, type = c("canonical","gamma","boxcar","user"), par =NULL, scale =10, hrf =NULL, verbose =FALSE)
Arguments
scans: number of scans
onsets: vector of onset times (in scans)
durations: vector of duration of ON stimulus in scans (if times==FALSE)) or seconds (if times==TRUE))
TR: time between scans in seconds (TR)
times: logical. If TRUE onsets and durations are given in units of time not number of scans. Defaults to FALSE.
sliceorder: order of slice acquisition. If provided separate expected bold responses are calculated for the slices taking slice acquisition times into account. Default: no slice timing.
type: One of "canonical", "gamma", "boxcar", "user"
par: Possible parameters to the HRF.
scale: Temporal undersampling factor
hrf: If type is "user" this should be a function evaluating the hemodynamic response function
verbose: Report more if TRUE
Details
The functions calculates the expected BOLD response for the task indicator function given by the argument as a convolution with the hemodynamic response function.
If sliceorder provides an ordering of slice acquisitions a matrix of expected Bold responses with columns corresponding to the slice number is computed.
For type is "canonical" the latter is modelled by the difference between two gamma functions as given in the reference (with the defaults for a1, a2, b1, b2, cc given therein):