Skip to content

Instantly share code, notes, and snippets.

@teonbrooks
Last active February 29, 2016 18:42
Show Gist options
  • Save teonbrooks/8dbf32040aeb2a3fa0db to your computer and use it in GitHub Desktop.
Save teonbrooks/8dbf32040aeb2a3fa0db to your computer and use it in GitHub Desktop.
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
raw = mne.io.read_raw_brainvision(fname_raw, eog=eog, misc=misc)
# you can see information about your file by calling the info
raw.info
# by default, MNE doesn't load the data into memory. you can access it with its
# built-in read-on-demand
# the data are arranged (channels x time), the following will return the first 100 samples
data, times = raw[:, :100]
# to plot your data, simply call the following
raw.plot()
# to filter, you must load the data first
raw.load_data()
# now you can filter: l_freq: low frequency cutoff, h_freq: high-frequency cutoff
raw.filter(0, 40)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment