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.

Functions:

compute_epi_mask(epi_img[, lower_cutoff, ...])

Compute a brain mask from fMRI data in 3D or 4D numpy.ndarray.

compute_multi_epi_mask(epi_imgs[, ...])

Compute a common mask for several sessions or subjects of fMRI data.

compute_brain_mask(target_img[, threshold, ...])

Compute the whole-brain, grey-matter or white-matter mask.

compute_multi_brain_mask(target_imgs[, ...])

Compute the whole-brain, grey-matter or white-matter mask for a list of images.

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.

intersect_masks(mask_imgs[, threshold, ...])

Compute intersection of several masks.

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.