Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.

nilearn.image.get_data#

nilearn.image.get_data(img)[source]#

Get the image data as a numpy.ndarray.

Parameters
imgNiimg-like object or iterable of Niimg-like objects

See http://nilearn.github.io/manipulating_images/input_output.html.

Returns
numpy.ndarray

3D or 4D numpy array depending on the shape of img. This function preserves the type of the image data. If img is an in-memory Nifti image it returns the image data array itself – not a copy.

Examples using nilearn.image.get_data#

Second-level fMRI model: one sample test

Second-level fMRI model: one sample test

Second-level fMRI model: one sample test
Massively univariate analysis of a motor task from the Localizer dataset

Massively univariate analysis of a motor task from the Localizer dataset

Massively univariate analysis of a motor task from the Localizer dataset