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 scipy.signal | |
import mne | |
from scipy.stats import kurtosis | |
from mne.preprocessing import find_outliers | |
from mne.fixes import nanmean | |
from mne.utils import logger | |
#from mne.preprocessing.eog import _get_eog_channel_index | |
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 matplotlib.pyplot as plt | |
from matplotlib.patches import Circle | |
import numpy as np | |
plt.figure() | |
s = [ 50000.,10478.2, 4733.4,3185.3,2484.7,2310.9] | |
for s_ in s: | |
radius = np.sqrt(s_)/np.pi | |
plt.gca().add_patch(Circle((1, radius), radius)) | |
plt.ylim(0, 150) |
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 | |
from numpy.testing import assert_allclose | |
nchannels, nsamples = 10, 100 | |
data = np.random.rand(nchannels, nsamples) | |
# Average reference | |
data_avg = data - np.mean(data, axis=0) | |
# Referenced to channel 0 |
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
# Python | |
import mne | |
import numpy as np | |
from matplotlib import pyplot as plt | |
# Channel positions | |
ch_names = ['A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'A10', 'A11', 'A12', 'A13', 'A14', 'A15', 'A16', 'A17', 'A18', 'A19', 'A20', 'A21', 'A22', 'A23', 'A24', 'A25', 'A26', 'A27', 'A28', 'A29', 'A30', 'A31', 'A32', 'B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8', 'B9', 'B10', 'B11', 'B12', 'B13', 'B14', 'B15', 'B16', 'B17', 'B18', 'B19', 'B20', 'B21', 'B22', 'B23', 'B24', 'B25', 'B26', 'B27', 'B28', 'B29', 'B30', 'B31', 'B32', 'C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8', 'C9', 'C10', 'C11', 'C12', 'C13', 'C14', 'C15', 'C16', 'C17', 'C18', 'C19', 'C20', 'C21', 'C22', 'C23', 'C24', 'C25', 'C26', 'C27', 'C28', 'C29', 'C30', 'C31', 'C32', 'D1', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7', 'D8', 'D9', 'D10', 'D11', 'D12', 'D13', 'D14', 'D15', 'D16', 'D17', 'D18', 'D19', 'D20', 'D21', 'D22', 'D23', 'D24', 'D25', 'D26', 'D27', 'D28', 'D29', 'D30', 'D31', 'D32'] | |
montage = mne.channels.read_montage('biosemi128') | |
info |
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 | |
import numpy as np | |
from scipy.stats import norm | |
from matplotlib import pyplot as plt | |
# Load required sample data | |
data_path = mne.datasets.sample.data_path() | |
subjects_dir = data_path + '/subjects' | |
evoked = mne.read_evokeds(data_path + '/MEG/sample/sample_audvis-ave.fif')[0] | |
fwd = mne.read_forward_solution(data_path + '/MEG/sample/sample_audvis-meg-eeg-oct-6-fwd.fif', surf_ori=False, force_fixed=True) |
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 __future__ import print_function | |
import os.path as op | |
import inspect | |
import distance | |
import numpy as np | |
from scipy.misc import comb | |
import progressbar as pb | |
import progressbar.widgets as pw |
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 __future__ import print_function | |
import mne | |
data_path = mne.datasets.sample.data_path() | |
subjects_dir = data_path + '/subjects' | |
subject = 'sample' | |
fname_inv = data_path + '/MEG/sample/sample_audvis-meg-oct-6-meg-inv.fif' | |
# Read the source space. Normally, you would use mne.read_source_spaces for | |
# this, but the sample data does not include a '-src.fif' file. Therefore, in |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
""" | |
============================== | |
Plotting the full MNE solution | |
============================== | |
The source space that is used for the inverse computation defines a set of | |
dipoles, distributed across the cortex. When visualizing a source estimate, it | |
is sometimes useful to show the dipole directions, as well as their estimated | |
magnitude. | |
""" |
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
def plot_source_estimates(stc, subject=None, surface=None, hemi='lh', | |
colormap='auto', time_label='auto', | |
smoothing_steps=10, transparent=None, | |
brain_alpha=None, alpha=None, vector_alpha=1., | |
scale_factor=None, time_viewer=False, | |
subjects_dir=None, figure=None, views='lat', | |
colorbar=True, clim='auto', cortex="classic", | |
size=800, background="black", foreground="white", | |
initial_time=None, time_unit='s', backend='auto', | |
spacing='oct6'): |
OlderNewer