Skip to content

Commit

Permalink
EGI/MFF events outside EEG recording should not break the code (#11505)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexandre Gramfort <[email protected]>
Co-authored-by: Alexandre Gramfort <[email protected]>
  • Loading branch information
3 people authored Feb 25, 2023
1 parent 32b686c commit 6d3e41f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mne/io/egi/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def _read_events(input_fname, info):
events = np.zeros([info['n_events'], info['n_segments'] * n_samples])
for n, event in enumerate(event_codes):
for i in mff_events[event]:
if (i < 0) or (i >= events.shape[1]):
continue
events[n][i] = n + 1
return events, info

Expand Down

0 comments on commit 6d3e41f

Please sign in to comment.