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 details)

Uploaded Source

File details

Details for the file hrf_estimation-0.2.tar.gz.

File metadata

  • Download URL: hrf_estimation-0.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for hrf_estimation-0.2.tar.gz
Algorithm Hash digest
SHA256 ced10da08a9303daee67718cb0a92b8302287a89e1469f772a37273cfc532acc
MD5 9934a31bf4591088cf77299d2e867fac
BLAKE2b-256 745676c6080eaff35a1cc2f44d793554ce99f2a48c4e21b366dfd2a2527e9c47

See more details on using hashes here.

Supported by

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