This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mne | |
# Make sure that your header, marker, and data file are in the same directory | |
fname_raw = 'path/to/header_file.vhdr' | |
# You can specify the EOG channels, and the miscellaneous channels | |
eog = [] | |
misc = [] | |
# to begin working with MNE, the only thing you need to specify is the header file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path as op | |
import inspect | |
from nose.tools import assert_equal, assert_true | |
from numpy.testing import assert_array_almost_equal, assert_array_equal | |
from numpy.testing import assert_raises | |
from scipy import io | |
import numpy as np | |
from mne.externals.six import iterbytes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import scipy as sp | |
import mne | |
mat = sp.io.loadmat('trig_s2.mat') | |
triggers, latency, urevent, duration, epoch = zip(*np.ravel(mat['triggers'])) | |
latency = np.array(latency).ravel() | |
triggers = np.array(triggers, int).ravel() | |
raw = mne.fiff.edf.read_raw_edf(raw.info,'s2_2.edf', preload=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def check_bad_chs(self, threshold=0.05, reject=3e-12, n_chan=5): | |
""" | |
Check for flat-line channels or channels that repeatedly exceeded | |
threshold. | |
""" | |
ds = self.load_events(drop_bad_chs=False) | |
ds = ds[ds['experiment'] == 'fixation'] | |
threshold = ds.n_cases * threshold | |
epochs = E.load.fiff.mne_epochs(ds, tmin=-.2, tmax=.6, | |
drop_bad_chs=False, verbose=False, |