6. Reference documentation: all nilearn functions

This is the class and function reference of nilearn. Please refer to the full user guide for further details, as the class and function raw specifications may not be enough to give full guidelines on their uses.

List of modules

6.1. nilearn.datasets: Automatic Dataset Fetching

User guide: See the Fetching open datasets section for further details.


6.2. nilearn.decoding: Decoding

Decoding tools and algorithms.


6.3. nilearn.decomposition: Multivariate decompositions

The nilearn.decomposition module includes a subject level variant of the ICA called Canonnical ICA.


6.4. nilearn.image: Image processing and resampling utilities

Mathematical operations working on Niimg-like objects like -a (3+n)-D block of data, and an affine.


6.5. nilearn.input_data: Loading and Processing files easily

The nilearn.input_data module includes scikit-learn tranformers and tools to preprocess neuro-imaging data.

User guide: See the NiftiMasker: loading, masking and filtering section for further details.


6.6. nilearn.masking: Data Masking Utilities

Utilities to compute and operate on brain masks

User guide: See the Masking the data: from 4D image to 2D array section for further details.


compute_epi_mask(epi_img[, lower_cutoff, ...]) Compute a brain mask from fMRI data in 3D or 4D ndarrays.
compute_multi_epi_mask(epi_imgs[, ...]) Compute a common mask for several sessions or subjects of fMRI data.
compute_background_mask(data_imgs[, ...]) Compute a brain mask for the images by guessing the value of the background from the border of the image.
compute_multi_background_mask(data_imgs[, ...]) Compute a common mask for several sessions or subjects of data.
apply_mask(imgs, mask_img[, dtype, ...]) Extract signals from images using specified mask.
unmask(X, mask_img[, order]) Take masked data and bring them back into 3D/4D

6.7. nilearn.region: Operating on regions

Functions for extracting region-defined signals.

Two ways of defining regions are supported: as labels in a single 3D image, or as weights in one image per region (maps).


img_to_signals_labels(imgs, labels_img[, ...]) Extract region signals from image.
signals_to_img_labels(signals, labels_img[, ...]) Create image from region signals defined as labels.
img_to_signals_maps(imgs, maps_img[, mask_img]) Extract region signals from image.
signals_to_img_maps(region_signals, maps_img) Create image from region signals defined as maps.

6.8. nilearn.mass_univariate: Mass-univariate analysis


6.9. nilearn.plotting: Plotting brain data

Plotting code for nilearn



OrthoSlicer(cut_coords[, axes, black_bg]) A class to create 3 linked axes for plotting orthogonal cuts of 3D maps.

6.10. nilearn.signal: Preprocessing Time Series

Preprocessing functions for time series.

All functions in this module should take X matrices with samples x features


clean(signals[, detrend, standardize, ...]) Improve SNR on masked fMRI signals.