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.

fetch_atlas_aal

nilearn.datasets.fetch_atlas_aal(version='3v2', data_dir=None, url=None, resume=True, verbose=1)[source]

Download and returns the AAL template for SPM 12.

For more information see the dataset description.

Warning

The integers in the map image (data.maps) that define the parcellation are not always consecutive, as is usually the case in Nilearn, and should not be interpreted as indices for the list of label names. In addition, the region IDs are provided as strings, so it is necessary to cast them to integers when indexing. For more information, refer to the fetcher’s description:

from nilearn.datasets import fetch_atlas_aal

atlas = fetch_atlas_aal()
print(atlas.description)
Parameters:
version{‘3v2’, ‘SPM12’, ‘SPM5’, ‘SPM8’}, default=’3v2’

The version of the AAL atlas. Must be ‘SPM5’, ‘SPM8’, ‘SPM12’, or ‘3v2’ for the latest SPM12 version of AAL3 software.

Changed in Nilearn 0.13.0: The default was changed to ‘3v2’.

data_dirpathlib.Path or str or None, optional

Path where data should be downloaded. By default, files are downloaded in a nilearn_data folder in the home directory of the user. See also nilearn.datasets.utils.get_data_dirs.

urlstr or None, default=None

URL of file to download. Override download URL. Used for test only (or if you setup a mirror of the data).

resumebool, default=True

Whether to resume download of a partly-downloaded file.

verbosebool or int, default=1

Verbosity level (0 or False means no message).

Returns:
datasklearn.utils.Bunch

Dictionary-like object, contains:

  • atlas_type: str. Type of atlas. See Probabilistic atlas and Deterministic atlas.

  • indices: list of str. Indices mapping labels to values in the maps image. This list has 117 elements in version SPM 5, 8 and 12, and 167 elements in version 3v2. Since the values in the ‘maps’ image do not correspond to indices in labels, but rather to values in indices, the location of a label in the labels list does not necessary match the associated value in the image. Use the indices list to identify the appropriate image value for a given label.

  • labels: list of str. List of the names of the regions. There are 117 names in version SPM 5, 8, and 12, and 167 names in version 3v2.

  • lut: pandas.DataFrame. Act as a look up table (lut) with at least columns ‘index’ and ‘name’. Formatted according to ‘dseg.tsv’ format from BIDS.

  • maps: str. Full path to 3D nifti file containing label image. The image has shape (91, 109, 91) and contains 117 unique integer values defining the parcellation in version SPM 5, 8 and 12, and 167 unique integer values defining the parcellation in version 3v2.

  • template: str. The standardized space of analysis in which the data is provided.

Notes

If the dataset files are already present in the user’s Nilearn data directory, this fetcher will not re-download them. To force a fresh download, you can remove the existing dataset folder from your local Nilearn data directory.

For more details on how Nilearn stores datasets.