def test(): """Running the analysis of the Brainstorm tutorial in MNE-Python""" print(__doc__) # Get test dataset data_path = bst_raw.data_path() # Read CTF dataset raw_fname = bst_raw.data_path( ) + '/MEG/bst_raw/' + 'subj001_somatosensory_20111109_01_AUX-f.ds' raw = mne.io.read_raw_ctf(raw_fname, preload=True) # Plot raw data raw.plot() # Set EOG channel raw.set_channel_types({'EEG058': 'eog'}) # Show power line interference raw.plot_psd() # Notch filter: 60Hz # raw.notch_filter(np.arange(60, 181, 60)) # Read events events = mne.find_events(raw, stim_channel='UPPT001') event_id = 2 # take right-hand somato # Pick MEG channels picks = mne.pick_types(raw.info, meg=True, eeg=False, stim=False, eog=True, exclude='bads') # Compute epochs: [-100, +300]ms epochs = mne.Epochs(raw, events, event_id, -0.1, 0.3, picks=picks, baseline=(None, 0), reject=dict(mag=4e-12, eog=250e-6), preload=False) # Compute evoked evoked = epochs.average() # Fix stim artifact mne.preprocessing.fix_stim_artifact(evoked) # Correct delays due to hardware (stim artifact is at 4 ms) evoked.shift_time(-0.004) # Plot the result evoked.plot() evoked.plot_topomap(times=np.array([0.016, 0.030, 0.060, 0.070]))
def test(): """Running the analysis of the Brainstorm tutorial in MNE-Python""" print(__doc__) tmin, tmax, event_id = -0.1, 0.3, 2 # take right-hand somato reject = dict(mag=4e-12, eog=250e-6) data_path = bst_raw.data_path() raw_fname = data_path + '/MEG/bst_raw/' + 'subj001_somatosensory_20111109_01_AUX-f_raw.fif' raw = mne.io.read_raw_fif(raw_fname, preload=True, add_eeg_ref=False) raw.plot() return raw """
# Authors: Mainak Jas <*****@*****.**> # # License: BSD (3-clause) import numpy as np import mne from mne.datasets.brainstorm import bst_raw print(__doc__) tmin, tmax, event_id = -0.1, 0.3, 2 # take right-hand somato reject = dict(mag=4e-12, eog=250e-6) data_path = bst_raw.data_path() raw_fname = data_path + '/MEG/bst_raw/' + \ 'subj001_somatosensory_20111109_01_AUX-f_raw.fif' raw = mne.io.read_raw_fif(raw_fname, preload=True, add_eeg_ref=False) raw.plot() # set EOG channel raw.set_channel_types({'EEG058': 'eog'}) raw.add_eeg_average_proj() # show power line interference and remove it raw.plot_psd() raw.notch_filter(np.arange(60, 181, 60)) events = mne.find_events(raw, stim_channel='UPPT001')
# Authors: Mainak Jas <*****@*****.**> # # License: BSD (3-clause) import numpy as np import mne from mne.datasets.brainstorm import bst_raw print(__doc__) tmin, tmax, event_id = -0.1, 0.3, 2 # take right-hand somato reject = dict(mag=4e-12, eog=250e-6) data_path = bst_raw.data_path() raw_fname = data_path + '/MEG/bst_raw/' + \ 'subj001_somatosensory_20111109_01_AUX-f_raw.fif' raw = mne.io.read_raw_fif(raw_fname, preload=True) raw.plot() # set EOG channel raw.set_channel_types({'EEG058': 'eog'}) raw.set_eeg_reference('average', projection=True) # show power line interference and remove it raw.plot_psd(tmax=60., average=False) raw.notch_filter(np.arange(60, 181, 60), fir_design='firwin') events = mne.find_events(raw, stim_channel='UPPT001')