metabci.brainda.datasets.tsinghua module

Tsinghua BCI Lab.

class metabci.brainda.datasets.tsinghua.BETA[source]

Bases: BaseDataset

BETA SSVEP dataset [1].

EEG data after preprocessing are store as a 4-way tensor, with a dimension of channel x time point x block x condition. Each trial comprises 0.5-s data before the event onset and 0.5-s data after the time window of 2 s or 3 s. For S1-S15, the time window is 2 s and the trial length is 3 s, whereas for S16-S70 the time window is 3 s and the trial length is 4 s. Additional details about the channel and condition information can be found in the following supplementary information.

Eight supplementary information is comprised of personal information, channel information, frequency and initial phase associated to each condition, SNR and sampling rate. The personal information contains age and gender of the subject. For the channel information, a location matrix (64 x 4) is provided, with the first column indicating channel index, the second column and third column indicating the degree and radius in polar coordinates, and the last column indicating channel name. The SNR information contains the mean narrow-band SNR and wide-band SNR matrix for each subject, calculated in (3) and (4), respectively. The initial phase is in radius.

3-100Hz bandpass filtering (eegfilt), downsampled to 250 Hz

References

Toward SSVEP-BCI Application[J]. Frontiers in neuroscience, 2020, 14: 627.

data_path(subject: str | int, path: str | Path | None = None, force_update: bool = False, update_path: bool | None = None, proxies: Dict[str, str] | None = None, verbose: bool | str | int | None = None) List[List[str | Path]][source]

Get path to local copy of a subject data.

Parameters:
  • subject (Union[str, int]) – subject id

  • path (Optional[Union[str, Path]], optional) – Location of where to look for the data storing location. If None, the environment variable or config parameter MNE_DATASETS_(dataset_code)_PATH is used. If it doesn’t exist, the “~/mne_data” directory is used. If the dataset is not found under the given path, the data will be automatically downloaded to the specified folder, by default None

  • force_update (bool, optional) – force update of the dataset even if a local copy exists, by default False

  • update_path (Optional[bool], optional) – If True, set the MNE_DATASETS_(dataset)_PATH in mne-python config to the given path. If None, the user is prompted, by default None

  • proxies (Optional[Union[bool, str, int]], optional) – proxies if needed

  • verbose (Optional[Union[bool, str, int]], optional) – [description], by default None

Returns:

local path of a subject data, the first list is session and the second list is run

Return type:

List[List[Union[str, Path]]]

get_freq(event: str)[source]
get_phase(event: str)[source]
class metabci.brainda.datasets.tsinghua.Wang2016[source]

Bases: BaseDataset

SSVEP dataset from Yijun Wang.

This dataset gathered SSVEP-BCI recordings of 35 healthy subjects (17 females, aged 17-34 years, mean age: 22 years) focusing on 40 characters flickering at different frequencies (8-15.8 Hz with an interval of 0.2 Hz). For each subject, the experiment consisted of 6 blocks. Each block contained 40 trials corresponding to all 40 characters indicated in a random order. Each trial started with a visual cue (a red square) indicating a target stimulus. The cue appeared for 0.5 s on the screen. Subjects were asked to shift their gaze to the target as soon as possible within the cue duration. Following the cue offset, all stimuli started to flicker on the screen concurrently and lasted 5 s. After stimulus offset, the screen was blank for 0.5 s before the next trial began, which allowed the subjects to have short breaks between consecutive trials. Each trial lasted a total of 6 s. To facilitate visual fixation, a red triangle appeared below the flickering target during the stimulation period. In each block, subjects were asked to avoid eye blinks during the stimulation period. To avoid visual fatigue, there was a rest for several minutes between two consecutive blocks. EEG data were acquired using a Synamps2 system (Neuroscan, Inc.) with a sampling rate of 1000 Hz. The amplifier frequency passband ranged from 0.15 Hz to 200 Hz. Sixty-four channels covered the whole scalp of the subject and were aligned according to the international 10-20 system. The ground was placed on midway between Fz and FPz. The reference was located on the vertex. Electrode impedances were kept below 10 KΩ. To remove the common power-line noise, a notch filter at 50 Hz was applied in data recording. Event triggers generated by the computer to the amplifier and recorded on an event channel synchronized to the EEG data.

The continuous EEG data was segmented into 6 s epochs (500 ms pre-stimulus, 5.5 s post-stimulus onset). The epochs were subsequently downsampled to 250 Hz. Thus each trial consisted of 1500 time points. Finally, these data were stored as double-precision floating-point values in MATLAB and were named as subject indices (i.e., S01.mat, …, S35.mat). For each file, the data loaded in MATLAB generate a 4-D matrix named ‘data’ with dimensions of [64, 1500, 40, 6]. The four dimensions indicate ‘Electrode index’, ‘Time points’, ‘Target index’, and ‘Block index’. The electrode positions were saved in a ‘64-channels.loc’ file. Six trials were available for each SSVEP frequency. Frequency and phase values for the 40 target indices were saved in a ‘Freq_Phase.mat’ file.

Information for all subjects was listed in a ‘Sub_info.txt’ file. For each subject, there are five factors including ‘Subject Index’, ‘Gender’, ‘Age‘ ’Handedness’, and ‘Group’. Subjects were divided into an ‘experienced’ group (eight subjects, S01-S08) and a ‘naive’ group (27 subjects, S09-S35) according to their experience in SSVEP-based BCIs.

Frequency Table 8 9 10 11 12 13 14 15 8.2 9.2 10.2 11.2 12.2 13.2 14.2 15.2 8.4 9.4 10.4 11.4 12.4 13.4 14.4 15.4 8.6 9.6 10.6 11.6 12.6 13.6 14.6 15.6 8.8 9.8 10.8 11.8 12.8 13.8 14.8 15.8

Notes

  1. sub5 is not available from the download url.

data_path(subject: str | int, path: str | Path | None = None, force_update: bool = False, update_path: bool | None = None, proxies: Dict[str, str] | None = None, verbose: bool | str | int | None = None) List[List[str | Path]][source]

Get path to local copy of a subject data.

Parameters:
  • subject (Union[str, int]) – subject id

  • path (Optional[Union[str, Path]], optional) – Location of where to look for the data storing location. If None, the environment variable or config parameter MNE_DATASETS_(dataset_code)_PATH is used. If it doesn’t exist, the “~/mne_data” directory is used. If the dataset is not found under the given path, the data will be automatically downloaded to the specified folder, by default None

  • force_update (bool, optional) – force update of the dataset even if a local copy exists, by default False

  • update_path (Optional[bool], optional) – If True, set the MNE_DATASETS_(dataset)_PATH in mne-python config to the given path. If None, the user is prompted, by default None

  • proxies (Optional[Union[bool, str, int]], optional) – proxies if needed

  • verbose (Optional[Union[bool, str, int]], optional) – [description], by default None

Returns:

local path of a subject data, the first list is session and the second list is run

Return type:

List[List[Union[str, Path]]]

get_freq(event: str)[source]
get_phase(event: str)[source]