nimare.extract
.fetch_neurosynth
- fetch_neurosynth(data_dir=None, version='7', overwrite=False, **kwargs)[source]
Download the latest data files from NeuroSynth.
Changed in version 0.0.10:
Use new format for Neurosynth and NeuroQuery files.
Change “path” parameter to “data_dir”.
Added in version 0.0.4.
- Parameters:
data_dir (
pathlib.Path
orstr
, optional) – Path where data should be downloaded. By default, files are downloaded in home directory. A subfolder, namedneurosynth
, will be created indata_dir
, which is where the files will be located.version (str or list, optional) – The version to fetch. The default is “7” (Neurosynth’s latest version).
overwrite (bool, optional) – Whether to overwrite existing files or not. Default is False.
kwargs (dict, optional) – Keyword arguments to select relevant feature files. Valid kwargs include: source, vocab, type. Each kwarg may be a string or a list of strings. If no kwargs are provided, all feature files for the specified database version will be downloaded.
- Returns:
found_databases – List of dictionaries indicating datasets downloaded. Each list entry is a different database, containing a dictionary with three keys: “coordinates”, “metadata”, and “features”. “coordinates” and “metadata” will be filenames. “features” will be a list of dictionaries, each containing “id”, “vocab”, and “features” keys with associated files.
- Return type:
Notes
This function was adapted from neurosynth.base.dataset.download().
Warning
Starting in version 0.0.10, this function operates on the new Neurosynth/NeuroQuery file format. Old code using this function will not work with the new version.