gen_hrf: Construct an HRF Instance

View source: R/hrf.R

gen_hrfR Documentation

Construct an HRF Instance

Description

gen_hrf takes a raw function f(t) and returns an HRF (Hemodynamic Response Function) instance.

Usage

gen_hrf(
  hrf,
  lag = 0,
  width = 0,
  precision = 0.1,
  summate = TRUE,
  normalize = FALSE,
  name = "gen_hrf",
  span = NULL,
  ...
)

Arguments

hrf

A function mapping from time to signal.

lag

Optional lag in seconds.

width

Optional block width in seconds.

precision

Sampling precision in seconds.

summate

Whether to allow each impulse response function to "add" up (default: TRUE).

normalize

Rescale so that the peak of the output is 1 (default: FALSE).

name

The assigned name of the generated HRF.

span

The span of the HRF (maximum width in seconds after which function reverts to zero).

...

Extra parameters for the hrf function.

Value

An instance of type HRF inheriting from function.

Examples


## Generate an HRF using SPMG1 canonical HRF, a lag of 3, and a width of 2.
grf <- gen_hrf(hrf_spmg1, lag=3, width=2)
grf(0:20)

hg <- purrr::partial(hrf_gaussian, mean=4, sd=1)
grf <- gen_hrf(hg, lag=1, width=2)

vals <- grf(0:20)

bbuchsbaum/fmrireg documentation built on May 16, 2023, 10:56 a.m.