Skip to main content

Statistical learning for neuroimaging in Python

Project description

Pypi Package PyPI - Python Version Github Actions Doc Build Status Github Actions Test Status Coverage Status https://zenodo.org/badge/DOI/10.5281/zenodo.8397156.svg Bluesky YouTube Channel Subscribers Mastodon Discord

nilearn

Nilearn enables approachable and versatile analyses of brain volumes and surfaces. It provides statistical and machine-learning tools, with instructive documentation & friendly community.

It supports general linear model (GLM) based analysis and leverages the scikit-learn Python toolbox for multivariate statistics with applications such as predictive modeling, classification, decoding, or connectivity analysis.

Install

Latest release

1. Setup a virtual environment

We recommend that you install nilearn in a virtual Python environment, either managed with the standard library venv or with conda (see miniconda for instance). Either way, create and activate a new python environment.

With venv:

python3 -m venv /<path_to_new_env>
source /<path_to_new_env>/bin/activate

Windows users should change the last line to \<path_to_new_env>\Scripts\activate.bat in order to activate their virtual environment.

With conda:

conda create -n nilearn python=3.10
conda activate nilearn

2. Install nilearn with pip

Execute the following command in the command prompt / terminal in the proper python environment:

python -m pip install nilearn

If you want to upgrade your current version:

python -m pip install --upgrade nilearn

Nilearn comes with optional plotting dependencies (matplotlib, plotly). If you want to install matplotlib:

python -m pip install 'nilearn[plotting]'

If you want to install matplotlib and plotly:

python -m pip install 'nilearn[plotting, plotly]'

Development version

Please find all development setup instructions in the contribution guide.

Check installation

Try importing nilearn in a python / iPython session:

import nilearn

If no error is raised, you have installed nilearn correctly.

Drop-in Hours

The Nilearn team organizes regular online drop-in hours to answer questions, discuss feature requests, or have any Nilearn-related discussions. Nilearn drop-in hours occur every Wednesday from 4pm to 5pm UTC, and we make sure that at least one member of the core-developer team is available. These events are held on Jitsi Meet and are fully open, anyone is welcome to join! For more information and ways to engage with the Nilearn team see How to get help.

Dependencies

The required dependencies to use the software are listed in the file pyproject.toml.

If you are using nilearn plotting functionalities or running the examples, matplotlib >= 3.8.0 is required.

Some plotting functions in Nilearn support both matplotlib and plotly as plotting engines. In order to use the plotly engine in these functions, you will need to install both plotly and kaleido, which can both be installed with pip and anaconda.

If you want to run the tests, you need pytest >= 6.0.0 and pytest-cov for coverage reporting.

Development

Detailed instructions on how to contribute are available at https://nilearn.github.io/stable/development.html

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

nilearn-0.14.0.tar.gz (56.8 MB view details)

Uploaded Source

Built Distribution

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

nilearn-0.14.0-py3-none-any.whl (11.5 MB view details)

Uploaded Python 3

File details

Details for the file nilearn-0.14.0.tar.gz.

File metadata

  • Download URL: nilearn-0.14.0.tar.gz
  • Upload date:
  • Size: 56.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for nilearn-0.14.0.tar.gz
Algorithm Hash digest
SHA256 2c3cf94b0f77461c242baf61b9efb4dd68dd4e2fc4eab19ae93e978b0c45b9b9
MD5 425a97b5f3fbf71984048ca4e3207b3f
BLAKE2b-256 dc0793844f4f3fdb7035da68350bbf6d39e9cf2bc04e32055b4fe534d10c7fd1

See more details on using hashes here.

File details

Details for the file nilearn-0.14.0-py3-none-any.whl.

File metadata

  • Download URL: nilearn-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for nilearn-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5dc6171c3b689e28c65c9951d0ac26158b825c5c37cfac959da73aae986eb1a7
MD5 8e67b001b9bd061d58f92334d97d9a37
BLAKE2b-256 db0ae687f94ddc15ba1ad186d3d69a800cafcfc267dbc9fe60b6eb30f5195a20

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