build_bids_path#

brainsets.utils.bids_utils.build_bids_path(bids_root, recording_id, modality)[source]#

Build a mne_bids.BIDSPath for a given recording_id, modality, and BIDS root directory.

Note: The BIDS root directory is the top-level folder of a BIDS dataset. All data and metadata within the dataset are organized relative to this root directory.

BIDSPath is a helper class from mne-bids for representing BIDS file paths and entities. For more information on BIDSPath, see: https://mne.tools/mne-bids/stable/generated/mne_bids.BIDSPath.html

Parameters:
  • bids_root (str | Path) – BIDS root directory (e.g., ‘/path/to/bids/root’)

  • recording_id (str) – Recording identifier (e.g., ‘sub-01_ses-01_task-Sleep’)

  • modality (Literal[['eeg', 'ieeg']]) – Modality (supported values: ‘eeg’, ‘ieeg’)

Return type:

None

Returns:

BIDSPath configured for reading via mne_bids.read_raw_bids.

Raises:

ValueError – If any unsupported BIDS entities are present in recording_id.