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.

7.2.29. nilearn.datasets.fetch_neurovault_ids

nilearn.datasets.fetch_neurovault_ids(collection_ids=(), image_ids=(), mode=’download_new’, data_dir=None, fetch_neurosynth_words=False, vectorize_words=True, verbose=3)

Download specific images and collections from neurovault.org.

Any downloaded data is saved on the local disk and subsequent calls to this function will first look for the data locally before querying the server for more if necessary.

This is the fast way to get the data from the server if we already know which images or collections we want.

Parameters:

collection_ids : Container, optional (default=())

The ids of whole collections to be downloaded.

image_ids : Container, optional (default=None)

The ids of particular images to be downloaded. The metadata for the corresponding collections is also downloaded.

mode : {‘download_new’, ‘overwrite’, ‘offline’}

When to fetch an image from the server rather than the local disk.

  • ‘download_new’ (the default) means download only files that are not already on disk (regardless of modify date).
  • ‘overwrite’ means ignore files on disk and overwrite them.
  • ‘offline’ means load only data from disk; don’t query server.

data_dir : str, optional (default=None)

The directory we want to use for nilearn data. A subdirectory named “neurovault” will contain neurovault data.

fetch_neurosynth_words : bool, optional (default=False)

whether to collect words from Neurosynth.

vectorize_words : bool, optional (default=True)

If neurosynth words are downloaded, create a matrix of word counts and add it to the result. Also add to the result a vocabulary list. See sklearn.CountVectorizer for more info.

verbose : int, optional (default=3)

an integer in [0, 1, 2, 3] to control the verbosity level.

Returns:

Bunch

A dict-like object which exposes its items as attributes. It contains:

  • ‘images’, the paths to downloaded files.
  • ‘images_meta’, the metadata for the images in a list of dictionaries.
  • ‘collections_meta’, the metadata for the collections.
  • ‘description’, a short description of the Neurovault dataset.

If fetch_neurosynth_words and vectorize_words were set, it also contains:

  • ‘vocabulary’, a list of words
  • ‘word_frequencies’, the weight of the words returned by neurosynth.org for each image, such that the weight of word vocabulary[j] for the image found in images[i] is word_frequencies[i, j]

See also

nilearn.datasets.fetch_neurovault
Fetch data from Neurovault, but use filters on metadata to select images and collections rather than giving explicit lists of ids.

Notes

Images and collections from disk are fetched before remote data.

In download_new mode, if a file exists on disk, it is not downloaded again, even if the version on the server is newer. Use overwrite mode to force a new download.

Stops early if too many images fail to be downloaded in a row.

References

[R3]Gorgolewski KJ, Varoquaux G, Rivera G, Schwartz Y, Ghosh SS, Maumet C, Sochat VV, Nichols TE, Poldrack RA, Poline J-B, Yarkoni T and Margulies DS (2015) NeuroVault.org: a web-based repository for collecting and sharing unthresholded statistical maps of the human brain. Front. Neuroinform. 9:8. doi: 10.3389/fninf.2015.00008
[R4]Yarkoni, Tal, Russell A. Poldrack, Thomas E. Nichols, David C. Van Essen, and Tor D. Wager. “Large-scale automated synthesis of human functional neuroimaging data.” Nature methods 8, no. 8 (2011): 665-670.

7.2.29.1. Examples using nilearn.datasets.fetch_neurovault_ids