Skip to content

Instantly share code, notes, and snippets.

@larsoner
Created January 5, 2020 19:21
Show Gist options
  • Select an option

  • Save larsoner/9e632fb37050de49acaf787e09986777 to your computer and use it in GitHub Desktop.

Select an option

Save larsoner/9e632fb37050de49acaf787e09986777 to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
import mne
data_path = mne.datasets.testing.data_path()
subjects_dir = data_path + '/subjects'
evoked = mne.read_evokeds(
data_path + '/MEG/sample/sample_audvis-ave.fif')[0]
evoked.apply_baseline((None, 0))
inv = mne.minimum_norm.read_inverse_operator(
data_path + '/MEG/sample/sample_audvis_trunc-meg-eeg-oct-4-meg-fixed-inv.fif')
stc = mne.minimum_norm.apply_inverse(
evoked, inv, 1. / 9, method='eLORETA', verbose='debug')
brain = stc.plot(
subjects_dir=subjects_dir, initial_time=0.1, smoothing_steps=5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment