NIPY logo

Site Navigation

NIPY Community

Table Of Contents

This Page

modalities.fmri.hrf

Module: modalities.fmri.hrf

This module provides definitions of various hemodynamic response functions (hrf).

In particular, it provides Gary Glover’s canonical HRF, AFNI’s default HRF, and a spectral HRF.

Functions

nipy.modalities.fmri.hrf.gamma_params(peak_location, peak_fwhm)

TODO: where does the coef come from again.... check fmristat code

From a peak location and peak fwhm, determine the parameters of a Gamma density

f(x) = coef * x**(alpha-1) * exp(-x*beta)

The coefficient returned ensures that the f has integral 1 over [0,np.inf]

Parameters:

peak_location : float

Location of the peak of the Gamma density

peak_fwhm : float

FWHM at the peak

Returns:

alpha : float

Shape parameter in the Gamma density

beta : float

Scale parameter in the Gamma density

coef : float

Coefficient needed to ensure the density has integral 1.

nipy.modalities.fmri.hrf.igamma_params(peak_location, peak_fwhm)

From a peak location and peak fwhm, determine the paramteres of a Gamma density and return an approximate (accurate) approximation of its integral f(x) = int_0^x coef * t**(alpha-1) * exp(-t*beta) dt so that lim_{x->infty} f(x)=1

Parameters:
peak_location : float

Location of the peak of the Gamma density

peak_fwhm : float

FWHM at the peak

Returns:

the function of t

NOTE: this is only a temporary fix, and will have to be removed in the long term