Skip to content

Instantly share code, notes, and snippets.

@Heneark
Last active July 11, 2018 13:14
Show Gist options
  • Save Heneark/a183a24218302831860efc86c84c1950 to your computer and use it in GitHub Desktop.
Save Heneark/a183a24218302831860efc86c84c1950 to your computer and use it in GitHub Desktop.
import mne
from mne.datasets.brainstorm import bst_phantom_ctf
from mne.io import read_raw_ctf
import os
data_path = bst_phantom_ctf.data_path()
raw_path = os.path.join(data_path, 'phantom_20uA_20150603_03.ds')
raw = read_raw_ctf(raw_path, preload=True)
epochs = mne.Epochs(raw, mne.make_fixed_length_events(raw), preload = True)
evoked = epochs.average()
data_cov = mne.compute_covariance(epochs)
fwd = mne.make_forward_solution(evoked.info, None, mne.setup_volume_source_space(), mne.make_sphere_model())
filters = mne.beamformer.make_lcmv(evoked.info, fwd, data_cov)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment