single_trial_regressor | R Documentation |
Creates a regressor object for modeling a single trial event in an fMRI experiment. This is particularly useful for trial-wise analyses where each trial needs to be modeled separately. The regressor represents the predicted BOLD response for a single event using a specified hemodynamic response function (HRF).
single_trial_regressor(
onsets,
hrf = HRF_SPMG1,
duration = 0,
amplitude = 1,
span = 24
)
onsets |
the event onset in seconds, must be of length 1. |
hrf |
a hemodynamic response function, e.g. |
duration |
duration of the event (default is 0) |
amplitude |
scaling vector (default is 1) |
span |
the temporal window of the impulse response function (default is 24) |
A single_trial_regressor object which inherits from regressor with the following components:
onsets: The onset time of the trial
duration: The duration of the trial
amplitude: The amplitude of the trial response
hrf: The HRF object used for convolution
regressor
for creating multiple trial regressors,
evaluate.single_trial_regressor
for evaluating the regressor,
HRF_SPMG1
for the default HRF
# Create a single trial regressor with default HRF
reg <- single_trial_regressor(c(10), HRF_SPMG1)
# Create a single trial regressor with custom HRF and amplitude
reg <- single_trial_regressor(c(10), HRF_GAMMA, amplitude = 2)
# Evaluate the regressor over a time grid
grid <- seq(0, 30, by = 0.5)
values <- evaluate(reg, grid)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.