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
- 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
#
![](../../_images/sphx_glr_plot_haxby_different_estimators_thumb.png)
Different classifiers in decoding the Haxby dataset
![](../../_images/sphx_glr_plot_data_driven_parcellations_thumb.png)
Clustering methods to learn a brain parcellation from fMRI
![](../../_images/sphx_glr_plot_roi_extraction_thumb.png)
Computing a Region of Interest (ROI) mask manually
![](../../_images/sphx_glr_plot_localizer_simple_analysis_thumb.png)
Massively univariate analysis of a calculation task from the Localizer dataset
![](../../_images/sphx_glr_plot_neurovault_meta_analysis_thumb.png)
NeuroVault meta-analysis of stop-go paradigm studies
![](../../_images/sphx_glr_plot_localizer_mass_univariate_methods_thumb.png)
Massively univariate analysis of a motor task from the Localizer dataset
![](../../_images/sphx_glr_plot_haxby_mass_univariate_thumb.png)
Massively univariate analysis of face vs house recognition