⬡PipelineHealthcareFree
Nilearn — Machine Learning for NeuroImaging
Python library for ML on brain imaging data: fMRI decoding, connectivity analysis, surface plotting.
Installs52k
Rating★ 4.7
Reviews17
Nilearn — Machine Learning for NeuroImaging
Nilearn is a Python library for machine learning on neuroimaging data (fMRI, MRI). It bridges scikit-learn with nibabel/NifTI data formats, enabling brain decoding, functional connectivity analysis, and biomarker extraction without low-level data wrangling.
Key features
- Mass-univariate GLM for fMRI task analysis (SPM-compatible)
- Functional connectivity matrices and ICA-based parcellations
- 30+ built-in brain atlases (AAL, Destrieux, Schaefer, DiFuMo)
- High-quality 3D/4D brain plot functions (glass brain, stat maps, surfaces)
- Compatible with BIDS-formatted datasets via niworkflows
Quick start
pip install nilearn
from nilearn import datasets, plotting
from nilearn.connectome import ConnectivityMeasure
# Load example resting-state data
data = datasets.fetch_development_fmri(n_subjects=5)
measure = ConnectivityMeasure(kind="correlation")
matrices = measure.fit_transform([img for img in data.func])
plotting.plot_matrix(matrices[0], colorbar=True)
plotting.show()
npx ai-supply add nilearn-neuroimaging-ml
Curated mirror of the open-source Nilearn (BSD-3-Clause). Get it from the source.