nispace.datasets.fetch_example

nispace.datasets.fetch_example(example, parcellation=None, return_associated_data=True, nispace_data_dir=None, overwrite=False, check_file_hash=True, verbose=True)[source]

Fetch an integrated example dataset, pre-parcellated with a given parcellation.

Parameters:
  • example (str) – Name of an integrated example dataset (case-insensitive).

  • parcellation (str or tuple of str, required) – Parcellation name (or cortex+subcortex tuple) the example was parcellated with. Currently required — only parcellated example data is available.

  • return_associated_data (bool, default True) – If True and the example has associated subject-level info (e.g. group, age, sex), also return it as a second DataFrame.

  • nispace_data_dir (str or Path, optional) – Deprecated; use the NISPACE_DATA_DIR environment variable instead.

  • overwrite (bool, default False) – Re-download files even if already cached locally.

  • check_file_hash (bool, default True) – Verify the SHA-256 hash of cached files against the known reference hash.

  • verbose (bool, default True) – Print progress messages.

Returns:

  • pd.DataFrame – Parcellated example data of shape (n_subjects/files, n_parcels).

  • pd.DataFrame – Only if return_associated_data=True and available: subject-level info, indexed to match example_data.

Raises:

ValueError – If example is not registered, parcellation is not given, or the example has no data for the requested parcellation.