Skip to main content

Functional PCA on fMRI data to extract dominant temporal components.

Project description

https://img.shields.io/pypi/v/neuro-fpca-fmri.svg https://img.shields.io/travis/yanivassf-lab/neuro-fpca-fmri.svg Documentation Status Updates

Overview

This module implements a functional principal component analysis (fPCA) pipeline designed for fMRI data. The overall procedure involves the following steps:

  1. Data Loading and Preprocessing

    The 4D fMRI image and an associated 3D binary mask are loaded. The mask extracts voxel-specific time series, and the time axis is defined based on the number of timepoints.

  2. B-Spline Basis Construction

    A set of B-spline basis functions is generated to represent smooth temporal dynamics. Each voxel’s time series is approximated as a linear combination of these basis functions.

  3. Penalty Matrix Construction

    A penalty matrix is computed to ensure smoothness of the estimated coefficients. This penalty is defined via an integral involving products of derivatives (typically the second derivative) of the basis functions.

  4. Regularized Spline Regression

    Each voxel time series is approximated by a spline expansion. The coefficients are estimated via a regularized regression problem, and a generalized cross-validation (GCV) criterion selects a voxel-specific regularization parameter (\(\lambda\)).

  5. Functional Principal Component Analysis

    PCA is performed on the coefficient matrix. Multiplying eigenfunctions by coefficients yields voxel-specific importance scores mapped back to brain images, while the basis applied to each eigenfunction gives the temporal dynamics curve shared across voxels.

Output

For each eigenfunction, the following figures are generated:

  • Voxel importance maps

    Voxel importance map
  • Intensity plot

    Temporal intensity plot
  • Signal intensity of best-scoring voxel

    Best voxel fit

Mathematical background

This program implements the methodology from:

Roberto Viviani, Georg Grön and Manfred Spitzer. Functional Principal Component Analysis of fMRI Data.

Full mathematical derivation is available here: Detailed Math Docs

Credits

This package was created using Cookiecutter and the audreyr/cookiecutter-pypackage template.

License

Author

Refael Kohen <refael.kohen@gmail.com>, Yaniv Assaf Lab, Tel Aviv University.

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

neuro_fpca_fmri-0.0.2.tar.gz (4.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neuro_fpca_fmri-0.0.2-py3-none-any.whl (77.5 kB view details)

Uploaded Python 3

File details

Details for the file neuro_fpca_fmri-0.0.2.tar.gz.

File metadata

  • Download URL: neuro_fpca_fmri-0.0.2.tar.gz
  • Upload date:
  • Size: 4.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for neuro_fpca_fmri-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7b55edf2626496855d6640be4df7873a6bbcda4cb78c9ef604b515e489c472b8
MD5 a61113f54eed6a9cd06b52a7ca9be2f5
BLAKE2b-256 5d76bf5c601ceeeb8c01bc6fd11fe91af7ae06e1a79f43aa36e78c9392ca1aa6

See more details on using hashes here.

File details

Details for the file neuro_fpca_fmri-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for neuro_fpca_fmri-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c2b2e15dfc1042de3ae9327d70b5b53c539e1a5e9f555d4de8c6a8457de7de6b
MD5 1cdff641650c16febdb25f7d09ba4111
BLAKE2b-256 9f1b259cb1d78d6850abbc60cd22066fedef629bb8383d6ebe80b0db25bf6513

See more details on using hashes here.

Supported by

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