Skip to contents

Retrieves an HRF by name from the registry and optionally applies decorators. This provides a unified interface for creating both pre-defined HRF objects and custom basis sets with specified parameters.

Usage

getHRF(
  name = "spmg1",
  nbasis = 5,
  span = 24,
  lag = 0,
  width = 0,
  summate = TRUE,
  normalize = FALSE,
  hrf_norm = "none",
  ...
)

Arguments

name

Character string specifying the HRF type. Options include:

  • "spmg1", "spmg2", "spmg3" - SPM canonical HRFs

  • "gamma", "gaussian" - Simple parametric HRFs

  • "fir" - Finite Impulse Response basis

  • "bspline" or "bs" - B-spline basis

  • "fourier" - Fourier basis

  • "daguerre" - Daguerre spherical basis

  • "tent" - Tent (linear spline) basis

  • "lwu" - Lag-Width-Undershoot HRF (see hrf_lwu); shape parameters tau, sigma, rho are passed via ...

nbasis

Number of basis functions (for basis set types)

span

Temporal window in seconds (default: 24)

lag

Time lag in seconds to apply (default: 0)

width

Block width for block designs (default: 0)

summate

Whether to sum responses in block designs (default: TRUE)

normalize

Whether to normalize the HRF (default: FALSE)

hrf_norm

Fixed-scale normalization mode passed to [normalize_hrf()]. The default `"none"` leaves the HRF unchanged. `normalize = TRUE` is the legacy per-basis unit-peak shortcut; do not supply both.

...

Additional arguments passed to generator functions (e.g., scale for daguerre, tau, sigma, rho for lwu)

Value

An HRF object

Details

For single HRF types (spmg1, gamma, gaussian), the function returns pre-defined objects. For basis set types (fir, bspline, fourier, daguerre), it calls the appropriate generator function with the specified parameters.

Examples

# Get pre-defined canonical HRF
canonical <- getHRF("spmg1")

# Create custom FIR basis with 20 bins
fir20 <- getHRF("fir", nbasis = 20, span = 30)

# Create B-spline basis with lag
bs_lag <- getHRF("bspline", nbasis = 8, lag = 2)

# Create blocked Gaussian HRF
block_gauss <- getHRF("gaussian", width = 5)