braindecode.datasets.bids.BIDSDataset#

class braindecode.datasets.bids.BIDSDataset(root, subjects=None, sessions=None, tasks=None, acquisitions=None, runs=None, processings=None, recordings=None, spaces=None, splits=None, descriptions=None, suffixes=None, extensions=<factory>, datatypes=None, check=False, extra_params=None, on_ch_mismatch='raise', preload=False, n_jobs=1)[source]#

Dataset for loading BIDS.

This class has the same parameters as the mne_bids.find_matching_paths() function as it will be used to find the files to load. The default extensions parameter was changed.

More information on BIDS (Brain Imaging Data Structure) can be found at https://bids.neuroimaging.io

Note

For loading “unofficial” BIDS datasets containing epoched data, you can use BIDSEpochsDataset.

Parameters:
  • root (Path | str) – The root of the BIDS path.

  • subjects (str | list[str] | None) – The subject ID. Corresponds to “sub”.

  • sessions (str | list[str] | None) – The acquisition session. Corresponds to “ses”.

  • tasks (str | list[str] | None) – The experimental task. Corresponds to “task”.

  • acquisitions (str | list[str] | None) – The acquisition parameters. Corresponds to “acq”.

  • runs (str | list[str] | None) – The run number. Corresponds to “run”.

  • processings (str | list[str] | None) – The processing label. Corresponds to “proc”.

  • recordings (str | list[str] | None) – The recording name. Corresponds to “rec”.

  • spaces (str | list[str] | None) – The coordinate space for anatomical and sensor location files (e.g., *_electrodes.tsv, *_markers.mrk). Corresponds to “space”. Note that valid values for space must come from a list of BIDS keywords as described in the BIDS specification.

  • splits (str | list[str] | None) – The split of the continuous recording file for .fif data. Corresponds to “split”.

  • descriptions (str | list[str] | None) – This corresponds to the BIDS entity desc. It is used to provide additional information for derivative data, e.g., preprocessed data may be assigned description='cleaned'.

  • suffixes (str | list[str] | None) – The filename suffix. This is the entity after the last _ before the extension. E.g., 'channels'. The following filename suffix’s are accepted: ‘meg’, ‘markers’, ‘eeg’, ‘ieeg’, ‘T1w’, ‘participants’, ‘scans’, ‘electrodes’, ‘coordsystem’, ‘channels’, ‘events’, ‘headshape’, ‘digitizer’, ‘beh’, ‘physio’, ‘stim’

  • extensions (str | list[str] | None) – The extension of the filename. E.g., '.json'. By default, uses the ones accepted by mne_bids.read_raw_bids().

  • datatypes (str | list[str] | None) – The BIDS data type, e.g., 'anat', 'func', 'eeg', 'meg', 'ieeg'.

  • check (bool) – If True, only returns paths that conform to BIDS. If False (default), the .check attribute of the returned mne_bids.BIDSPath object will be set to True for paths that do conform to BIDS, and to False for those that don’t.

  • preload (bool) – If True, preload the data. Defaults to False.

  • n_jobs (int) – Number of jobs to run in parallel. Defaults to 1.