Skip to content

Commit

Permalink
Merge pull request #106 from sylvchev/event-mne
Browse files Browse the repository at this point in the history
Correct event detection problem and duplicate event error
  • Loading branch information
Sylvain Chevallier authored Jul 13, 2020
2 parents 17eb0cd + e8d8222 commit 1ce83d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions moabb/paradigms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,12 @@ def process_raw(self, raw, dataset, return_epochs=False):
event_id = self.used_events(dataset)

# find the events, first check stim_channels then annotations
stim_channels = mne.utils._get_stim_channel(
None, raw.info, raise_error=False)
stim_channels = mne.utils._get_stim_channel(None, raw.info,
raise_error=False)
if len(stim_channels) > 0:
events = mne.find_events(raw, shortest_event=0, verbose=False)
else:
events, _ = mne.events_from_annotations(raw, event_id=event_id,
verbose=False)
events, _ = mne.events_from_annotations(raw, verbose=False)
channels = () if self.channels is None else self.channels

# picks channels
Expand Down Expand Up @@ -143,6 +142,7 @@ def process_raw(self, raw, dataset, return_epochs=False):
tmin=tmin, tmax=tmax, proj=False,
baseline=None, preload=True,
verbose=False, picks=picks,
event_repeated='drop',
on_missing='ignore')
if self.resample is not None:
epochs = epochs.resample(self.resample)
Expand Down

0 comments on commit 1ce83d8

Please sign in to comment.