Functional PCA on fMRI data to extract dominant temporal components.
Project description
Full Documentation
Github Repository: https://github.com/yanivassf-lab/fMRI
Documentation: https://fmri.readthedocs.io
Overview
This module implements a functional principal component analysis (fPCA) pipeline designed for fMRI data. The overall procedure involves the following steps:
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.
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.
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.
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\)).
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
Intensity plot
Signal intensity of best-scoring voxel
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
Free software: GNU GPLv3
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neuro_fpca_fmri-0.0.4.tar.gz.
File metadata
- Download URL: neuro_fpca_fmri-0.0.4.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc8b253e4caba9dd6eebd531f99a0e614c0f17a9af1c317d2915008865bb3ba2
|
|
| MD5 |
810b8ffa6fd6044c7ba5c684a4dd9055
|
|
| BLAKE2b-256 |
aeb06dc34da5f18cc074901eb527f92744498330d5c56c3b389d6c64a024c900
|
File details
Details for the file neuro_fpca_fmri-0.0.4-py3-none-any.whl.
File metadata
- Download URL: neuro_fpca_fmri-0.0.4-py3-none-any.whl
- Upload date:
- Size: 77.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
248324720d5886fdff51bada9fefb19b6a79539c8d6e11e8c24a0688ab777cc0
|
|
| MD5 |
e9c994d928029bf3d08ad7125f572a80
|
|
| BLAKE2b-256 |
358e974cded1a716fd244e66413feaa6604c7e4e3150d7b9865f85431a9951b3
|