This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import numpy as np | |
from numpy.testing import assert_allclose | |
from scipy import linalg | |
from scipy.stats import ortho_group | |
def _multi_corr(x, y, rescale=True): | |
"""Compute correlations between terms in a rotation-invariant way.""" |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
""" | |
Simulate the sample dataset | |
=========================== | |
Here we use :func:`mne.simulation.simulate_raw` to simulate the sample dataset | |
and then do source localization on the result. | |
""" | |
import os.path as op |
This file contains hidden or 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
# From mne/doc directory: | |
# make clean; rm -f ~/Desktop/prof.prof && python -m cProfile -o ~/Desktop/prof.prof ~/Desktop/doc.py && snakeviz ~/Desktop/prof.prof # noqa | |
import os | |
import sys | |
os.environ['BUILD_DEV_HTML'] = '1' | |
os.chdir('/home/larsoner/python/mne-python/doc') | |
sys.argv = ['sphinx-build', '-D', 'plot_gallery=0', '-b', 'html', '-nWT', | |
'--keep-going', '-d', '_build/doctrees', '.', '_build/html'] | |
from sphinx import __main__ # noqa |
This file contains hidden or 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 io | |
import json | |
import numpy as np | |
from expyfun.io import read_hdf5 | |
from expyfun.analyze import decimals_to_binary | |
# make the blank trigger pulses | |
fs = 44100. | |
trig_on_dur = 10e-3 | |
trig_pause_dur = 10e-3 |
This file contains hidden or 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 | |
import mne | |
from mne.datasets import sample | |
from mne.minimum_norm import apply_inverse, read_inverse_operator | |
import numpy as np | |
sample_dir_raw = sample.data_path() | |
sample_dir = os.path.join(sample_dir_raw, 'MEG', 'sample') | |
subjects_dir = os.path.join(sample_dir_raw, 'subjects') | |
fname_evoked = os.path.join(sample_dir, 'sample_audvis-ave.fif') |
This file contains hidden or 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 | |
from mne.utils import object_diff | |
from mne.forward.forward import is_fixed_orient, convert_forward_solution | |
from mne.datasets import sample | |
data_path = sample.data_path() | |
fname_fwd = data_path + '/MEG/sample/sample_audvis-meg-oct-6-fwd.fif' | |
fname_inv = data_path + '/MEG/sample/sample_audvis-meg-oct-6-meg-inv.fif' | |
fwd = mne.read_forward_solution(fname_fwd) | |
inv = mne.minimum_norm.read_inverse_operator(fname_inv) |
This file contains hidden or 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
# Create a DigMontage for sample in MRI coordinates | |
import os.path as op | |
import numpy as np | |
import nibabel | |
import mne | |
from mne.transforms import apply_trans | |
from mne.io.constants import FIFF | |
from mne.channels import make_dig_montage, read_custom_montage |
This file contains hidden or 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 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import mne | |
data_path = mne.datasets.sample.data_path() | |
# Closes #3987, #4880, #5190, #5472, #6304 | |
# Places where we use _auto/_find_topomap_coords that probably need checking: | |
# |
This file contains hidden or 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 | |
from sklearn.pipeline import make_pipeline | |
from sklearn.preprocessing import StandardScaler | |
from sklearn.linear_model import LogisticRegression | |
import mne | |
from mne.datasets import sample | |
from mne.decoding import GeneralizingEstimator | |
# Need cluster_level, time_delaying_ridge |
This file contains hidden or 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 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)) |