Skip to content

Instantly share code, notes, and snippets.

@drammock
Last active March 19, 2020 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drammock/475d6a0aef16468d2013f145d7dd0151 to your computer and use it in GitHub Desktop.
Save drammock/475d6a0aef16468d2013f145d7dd0151 to your computer and use it in GitHub Desktop.
example showing how to have different rejection thresholds for HEOG and VEOG
import os
import mne
# load sample data
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False).crop(tmax=60)
events = mne.find_events(raw, stim_channel='STI 014')
# hack to change channel type (demonstrating with 'EEG 060'; you would use
# HEOG channel name(s) instead)
raw.set_channel_types({'EEG 060': 'misc'})
reject_criteria = dict(misc=100e-6, eog=200e-6)
epochs = mne.Epochs(raw, events, tmin=-0.2, tmax=0.5, reject=reject_criteria,
preload=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment