- MNE-Python version: 0.23.4
- operating system: Windows
fname = "/EEG_data/subj1.set"
raw = mne.io.read_raw_eeglab(fname, preload=True)
raw_events, raw_event_id = mne.events_from_annotations(raw) #Q1
events_stim_to_resp = mne.pick_events(raw_events,exclude=[13,51,52,53,54])
epochs = mne.Epochs(raw, events=events_stim_to_resp , event_id=raw_event_id, tmin=- 0.2, tmax=0.5, baseline = (-0.4,0), preload=True) #Q2
print(raw_event_id)
Used Annotations descriptions: ['11', '12', '13', '14', '21', '22', '23', '24', '51', '52', '53', '54', 'boundary']
{'11': 1, '12': 2, '13': 3, '14': 4, '21': 5, '22': 6, '23': 7, '24': 8, '51': 9, '52': 10, '53': 11, '54': 12, 'boundary': 13}
events_stim_to_resp[0:9]
array([[ 467, 0, 3],
[ 1068, 0, 7],
[ 7256, 0, 2],
[ 7545, 0, 6],
[ 9851, 0, 3],
[10207, 0, 7],
[10686, 0, 1],
[10986, 0, 5],
[11528, 0, 3]])
How to read all fields from EEG.event / any workaround to import them from csv and then using it?
Reference: support user-defined event fields in mne.read_epochs_eeglab() · Issue #3837 · mne-tools/mne-python · GitHub
In the discussion, it can be seen that - “For legacy reasons, the events array will not be extented beyond a 3-column integer array.”
Q1. If I wanted to pick a field other than the "0"s column, is it possible?
Q2. Is there a way to use a variable latencies for event epoching instead of the fixed tmin-tmax duration?
I want to split the continuous data from events 3-7, 2-6 . . . and use the tmin-tmax values as 467-1068, 7256-7545 . . . Is there a way to do this directly? If not, any suggestion for workaround is also appreciated