Skip to content

Commit 6d3e41f

Browse files
EGI/MFF events outside EEG recording should not break the code (mne-tools#11505)
Co-authored-by: Alexandre Gramfort <[email protected]> Co-authored-by: Alexandre Gramfort <[email protected]>
1 parent 32b686c commit 6d3e41f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mne/io/egi/events.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def _read_events(input_fname, info):
2929
events = np.zeros([info['n_events'], info['n_segments'] * n_samples])
3030
for n, event in enumerate(event_codes):
3131
for i in mff_events[event]:
32+
if (i < 0) or (i >= events.shape[1]):
33+
continue
3234
events[n][i] = n + 1
3335
return events, info
3436

0 commit comments

Comments
 (0)