download_dataset_description#

torch_brain.utils.openneuro.download_dataset_description(dataset_id, target_dir, *, redownload=False)[source]#

Download dataset_description.json from OpenNeuro S3.

This file is required for mne-bids to recognize a valid BIDS dataset. If the file already exists locally, it is not re-downloaded unless redownload is True.

Parameters:
  • dataset_id (str) – The OpenNeuro dataset identifier

  • target_dir (Path) – Local directory to download to

  • redownload (bool) – If True, re-download and overwrite any existing local file. If False (default), an existing local file is returned as-is.

Return type:

Path

Returns:

Path to the downloaded or existing dataset_description.json file

Raises:

RuntimeError – If download fails or file doesn’t exist on S3