I am trying to deal with my EEG data by this documentation:
https://mne.tools/stable/auto_examples/decoding/decoding_csp_eeg.html
when I switch the data sort to my EEG data through this:
#LOAD DATA
subj = 'S1'
f_name = f'{subj}_mi1.cnt'
data_path = os.path.join('../data/eeg/S1/')
raw = mne.io.read_raw_cnt(os.path.join(data_path, f_name), preload=True)
# drop bad channels
raw.drop_channels(['left chn', 'rigth chn', 'M1', 'M2', 'CB1', 'CB2'])
print(raw.info['ch_names'])
raw.plot()
plt.show()
#raw_fnames = eegbci.load_data(subject, runs)
#raw = concatenate_raws([read_raw_edf(f, preload=True) for f in raw_fnames])
eegbci.standardize(raw) # set channel names
montage = make_standard_montage('standard_1005')
raw.set_montage(montage)
# strip channel names of "." characters
raw.rename_channels(lambda x: x.strip('.'))
# Apply band-pass filter
raw.filter(7., 30., fir_design='firwin', skip_by_annotation='edge')
events, _ = events_from_annotations(raw, event_id=dict(T1=2, T2=3))
picks = pick_types(raw.info, meg=False, eeg=True, stim=False, eog=False,
exclude='bads')
# Read epochs (train will be done only between 1 and 2s)
# Testing will be done with a running classifier
epochs = Epochs(raw, events, event_id, tmin, tmax, proj=True, picks=picks,
baseline=None, preload=True)
epochs_train = epochs.copy().crop(tmin=1., tmax=2.)
labels = epochs.events[:, -1] - 2
it comes with the error:
ValueError: Could not find any of the events you specified.
dont know where goes wrong and how to fix this?