fetch_eeg_recordings#

brainsets.utils.bids_utils.fetch_eeg_recordings(source)[source]#

Discover all EEG recordings inside a BIDS dataset or list of files.

Parameters:

source (None | Path | str | list[None | Path | str]) – Either the BIDS root directory (as a str, Path, or BIDSPath), or a list of files (each item being a str, Path, or BIDSPath).

Return type:

list[dict]

Returns:

List of dicts with key/value pairs for BIDS entities extracted from the fetched recording files.
  • recording_id: Full recording identifier (e.g., ‘sub-01_ses-01_task-Sleep’)

  • subject_id: Subject identifier (e.g., ‘sub-01’)

  • session_id: Session identifier or None (e.g., ‘ses-01’)

  • task_id: Task identifier (e.g., ‘Sleep’)

  • acquisition_id: Acquisition identifier or None (e.g., ‘headband’)

  • run_id: Run identifier or None (e.g., ‘01’)

  • description_id: Description identifier or None (e.g., ‘preproc’)

  • fpath: Relative path to EEG file

For more information on BIDS entities, see: https://bids-specification.readthedocs.io/en/stable/appendices/entities.html

Notes

If source is a BIDSPath pointing to a subfolder inside the BIDS root directory, this function will return all EEG recording files within that specific subfolder. This does not work if the subfolder is a string or Path object.