Skip to main content

A module for estimating Hemodynamical Response Function from functional MRI data

Project description

This describes a Python package that implements the routines described in the paper

“HRF estimation improves sensitivity of fMRI encoding and decoding models”, Fabian Pedregosa, Michael Eickenberg, Bertrand Thirion and Alexandre Gramfort (submitted)

Get the code

hrf_estimation is a Python package. It can be installed through the Python Package Index (PYPI):

pip install -U hrf_estimation

You can also download the source code from the PYPI website

Function reference

The principal function is rank_one

def rank_one(X, Y, alpha, size_u, u0=None, v0=None, Z=None, rtol=1e-6, verbose=False, maxiter=1000):
"""
 multi-target rank one model

     ||y - X vec(u v.T) - Z w||^2 + alpha * ||u - u_0||^2

 Parameters
 ----------
 X : array-like, sparse matrix or LinearOperator, shape (n, p)
     The design matrix

 Y : array-lime, shape (n, k)
     Time-series vector. Several time-series vectors can be given at once,
     however for large system becomes unstable. We do not recommend
     using more than k > 100.

 size_u : integer
     Must be divisor of p

 u0 : array

 Z : array, sparse matrix or LinearOperator, shape (n, q)
     Represents the drift vectors.

 rtol : float
     Relative tolerance

 maxiter : int
     maximum number of iterations

 verbose : boolean

 Returns
 -------
 U : array, shape (size_u, k)
 V : array, shape (p / size_u, k)
 W : coefficients associated to the drift vectors
 """

Examples

This IPython notebook contains code that reproduces the figures from the original article. Development

The newest version can alway be grabbed from the git repository. Feel free to submit patches, issues or implementations for other languages!.

TODO: provide fallback for einsum

Authors

Fabian Pedregosa <fabian@fseoane.net> Michael Eickenberg <michael.eickenberg@nsup.org>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hrf_estimation-0.2.tar.gz (3.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page