A comprehensive toolkit for fMRI data analysis and visualization
Project description
FMRI Toolkit
A comprehensive Python toolkit for functional Magnetic Resonance Imaging (fMRI) data analysis and visualization.
Features
Core Analysis
- Stimulus Detection: Multiple statistical tests for detecting brain activation
- Real-valued tests: t-test, Wilcoxon, on/off difference, HRF GLM
- Complex-valued tests: Hotelling's T², Wilks-Lambda, generalized LRT
- Support for 1D-4D data
- Post-hoc Processing: FDR correction and spatial clustering (6-, 18-, or 26-connectivity)
- P-value Adjustment: Multiple testing correction methods (Bonferroni, Holm, Benjamini-Hochberg)
Visualization
- 3D Brain Visualization: Interactive 3D brain maps using Plotly
- 2D Slice Visualization: Sagittal, axial, and coronal slice views
- Regional Visualization: ROI-based 3D visualization
- Comparison Tools: Side-by-side comparison of multiple p-value maps (2D and 3D)
ROI Analysis
- Phase 1: Detect activated regions of interest using statistical tests
- Phase 2: ROI-based tensor-on-tensor regression analysis
Time Series Analysis
- Time Series Visualization: Interactive time series exploration
- Forecasting: Time series forecasting capabilities for fMRI data
Data Simulation
- Generate synthetic fMRI data with specified activation regions and stimulus timing
Installation
From PyPI (when published)
pip install fmri-toolkit
From source
git clone https://github.com/yourusername/fmri-toolkit.git
cd fmri-toolkit
pip install -e .
Quick Start
import fmri_toolkit as fmri
# Load fMRI data
data = fmri.fmri_load_mat('path/to/data.mat')
# Perform stimulus detection
result = fmri.fmri_stimulus_detect(
fmridata=data,
mask=mask,
stimulus_idx=stimulus_indices,
rest_idx=rest_indices,
method='t-test'
)
# Apply post-hoc correction
processed = fmri.fmri_post_hoc(
result,
alpha=0.05,
method='BH',
spatial_cluster=True
)
# Visualize results in 3D
fmri.fmri_3dvisual(
processed,
title='Brain Activation Map',
color_scheme='hot'
)
Requirements
- Python >= 3.8
- NumPy >= 1.20.0
- SciPy >= 1.7.0
- Pandas >= 1.3.0
- Matplotlib >= 3.4.0
- Plotly >= 5.0.0
- And other dependencies (see
pyproject.toml)
Documentation
For detailed documentation, examples, and API reference, visit the documentation.
Examples
Check the examples/ directory for complete usage examples:
runall.py: Full analysis pipeline demonstration
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Citation
If you use this toolkit in your research, please cite:
@software{fmri_toolkit,
title={FMRI Toolkit: A Python Package for fMRI Data Analysis},
author={Johnny In},
year={2024},
url={https://github.com/yourusername/fmri-toolkit}
}
Support
For issues, questions, or suggestions, please open an issue on GitHub.
Project details
Release history Release notifications | RSS feed
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 fmri_toolkit-0.1.0.tar.gz.
File metadata
- Download URL: fmri_toolkit-0.1.0.tar.gz
- Upload date:
- Size: 42.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eca783f6b41433a660192bf07fed610759a9216dda6adccbd8e6898d084c9974
|
|
| MD5 |
0f6c07ba42ab00bbe573d8f36cde1a58
|
|
| BLAKE2b-256 |
08fb6facbf72a991c7414cf3e2d692462e3c111e0c8fee5d8522ad3c0a95c4cf
|
File details
Details for the file fmri_toolkit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: fmri_toolkit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 45.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
caeb7a171a22c8914bd61f83578e3cc82016b1df5c7404bce45f7051b9e76c89
|
|
| MD5 |
3e81a748f13c3be8f5ecedfae3ebe0b2
|
|
| BLAKE2b-256 |
04778d260fe20fd749ba791e2f58a025222b9fd3093ef2855396d495c4c30e64
|