skillfed

nilearn

Statistical learning for neuroimaging in Python

nilearn v0.14.0 287.3K downloads/30d#8,035 on PyPI1,424
Permissive license BSD-3-Clause Active released

What it is and what it does

Nilearn is a Python library for statistical and machine-learning analysis of brain imaging data. It integrates scikit-learn's multivariate statistics with neuroimaging-specific tools, supporting general linear model (GLM) analysis on brain volumes and surfaces. The package is designed for researchers and developers working with fMRI, structural imaging, or other neuroimaging modalities who need accessible statistical and predictive modeling capabilities.

The library depends on core scientific Python packages (numpy, scipy, pandas, scikit-learn, nibabel) for numerical computation and neuroimaging file handling. It includes optional plotting support via matplotlib and plotly. The project maintains active development with regular releases, comprehensive documentation, and a community-oriented approach including weekly drop-in hours for user support.

Use it for:

  • Perform GLM-based statistical analysis on fMRI data to identify brain regions associated with experimental conditions
  • Build predictive models for brain decoding tasks using multivariate pattern analysis with scikit-learn integration
  • Analyze functional connectivity between brain regions and classify brain states from imaging data
  • Visualize and explore brain volume and surface data with integrated plotting tools
  • Conduct group-level statistical inference on neuroimaging datasets across multiple subjects

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Nilearn provides statistical and machine-learning tools for analyzing brain imaging data, supporting GLM-based analysis and multivariate statistics via scikit-learn integration.

Yes. Nilearn is actively maintained, has low install friction, carries a permissive license, and addresses a specific scientific need with established community support. It is well-suited for researchers and developers doing neuroimaging analysis in Python. No known security vulnerabilities.

Install

nilearn on PyPI

pip

pip install nilearn

uv

uv add nilearn

poetry

poetry add nilearn

Installing nilearn

Before you install

Low install friction with a pure-Python wheel distribution. Active maintenance with a recent release 43 days ago and ongoing repository activity. Requires Python 3.10 or later.

License in practice

BSD-3-Clause permissive license allows commercial and private use with minimal restrictions, requiring only preservation of copyright and license notices.

Quickstart

pip install nilearn

import nilearn
from nilearn import image
# Load and analyze brain imaging data using nilearn's statistical tools

Requires Python 3.10 or later. Optional plotting features require matplotlib >= 3.8.0 or plotly + kaleido for advanced visualization.

Verify before relying

  • Whether the package's GLM analysis and multivariate statistics capabilities cover your specific neuroimaging use case
  • Performance characteristics when working with large-scale brain imaging datasets
  • Availability and quality of community support beyond the documented drop-in hours

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 9 — jinja2, joblib, nibabel, numpy, packaging, pandas, requests, scikit-learn, scipy
Maintenance actively maintained — 43 days since the last release
Last repo commit
First released
Downloads 287,281/month — #8,035 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: nilearn-0.14.0-py3-none-any.whl

Intended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: UnixProgramming Language :: CProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/EngineeringTopic :: Software Development

Tags

neuroimaging analysis pythonbrain imaging statistical learningfmri data analysismultivariate brain statisticsneuroimaging machine learningbrain volume surface analysisglm neuroimaging
neuroimagingbrain-analysisscientific-computing

More Software Development packages