CBCIC

Description

This module provides functionality to load EEG data from the CBCIC dataset. It processes the data to fit the requirements of the eegdata dictionary, which is used to store and process EEG data.

bciflow.datasets.cbcic.cbcic(subject: int = 1, session_list: list = None, labels: list = ['left-hand', 'right-hand'], path: str = 'data/cbcic/')[source]

This function loads EEG data for a specific subject and session from the CBCIC dataset. It processes the data to fit the structure of the eegdata dictionary, which is used for further processing and analysis.

Parameters:
  • subject (int, optional) – Index of the subject to retrieve the data from. Must be between 1 and 9. Default is 1.

  • session_list (list, optional) – List of session codes to load. Valid options are ‘T’ (training) and ‘E’ (evaluation). If None, all sessions are loaded. Default is None.

  • labels (list, optional) – List of labels to include in the dataset. Valid options are ‘left-hand’ and ‘right-hand’. Default is [‘left-hand’, ‘right-hand’].

  • path (str, optional) – Path to the folder containing the dataset files. Default is ‘data/cbcic/’.

Returns:

A dictionary containing the following keys:

X: EEG data as a numpy array. y: Labels corresponding to the EEG data. sfreq: Sampling frequency of the EEG data. y_dict: Mapping of labels to integers. events: Dictionary describing event markers. ch_names: List of channel names. tmin: Start time of the EEG data.

Return type:

dict

Raises:

ValueError – If any of the input parameters are invalid or if the specified file does not exist.

Examples

Load EEG data for subject 1, all sessions, and default labels:

>>> eeg_data = cbcic(subject=1)
>>> print(eeg_data['X'].shape)  # Shape of the EEG data
>>> print(eeg_data['y'])  # Labels