This file contains 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 | |
tbl_data = np.zeros((2, 100)) | |
tbl_data[0] = 1000 + np.arange(100) | |
tbl_data[1] = 3 * np.arange(100) | |
tableNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLTableNode') | |
updateTableFromArray(tableNode, tbl_data.transpose()) | |
tableNode.GetTable().GetColumn(0).SetName('X') | |
tableNode.GetTable().GetColumn(1).SetName('Y') |
This file contains 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_tfr(tfr, vmin, vmax, axes=None, colorbar=False, title=None, | |
set_chan_title=True, show=True): | |
from mne.viz.utils import center_cmap | |
from matplotlib import pyplot as plt | |
cmap = center_cmap(plt.cm.RdBu_r, vmin, vmax) # zero maps to white | |
n_chans = len(tfr.ch_names) | |
if axes is None: | |
if colorbar: | |
w_ratios = list(np.repeat(10, n_chans)) + [1] | |
fig, axes = plt.subplots(1, n_chans + 1, figsize=(12, 4), |
This file contains 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
name: hnn | |
channels: | |
- defaults | |
dependencies: | |
- python>=3.6 | |
- pip | |
- numpy | |
- scipy | |
- matplotlib | |
- cython |
This file contains 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
""" | |
================================ | |
Brainstorm resting state dataset | |
================================ | |
Here we compute the resting state from raw for the | |
Brainstorm tutorial dataset. For comparison, see [1]_ and: | |
http://neuroimage.usc.edu/brainstorm/Tutorials/MedianNerveCtf |
This file contains 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.path as op | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import mne | |
data_path = mne.datasets.sample.data_path() | |
fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis-ave.fif') | |
evoked = mne.read_evokeds(fname, baseline=(None, 0), proj=True) |
This file contains 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 import read_trans | |
from mne import io | |
import os.path as op | |
from mne.io.constants import FIFF | |
from mne.transforms import apply_trans, combine_transforms | |
ds_fname = 'test.ds' | |
meas_fname = '%s-info.fif' % op.splitext(ds_fname)[0] |
This file contains 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.path as op | |
import matplotlib.pyplot as plt | |
import mne | |
data_path = mne.datasets.sample.data_path() | |
fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis-ave.fif') | |
evoked = mne.read_evokeds(fname, baseline=(None, 0), proj=True) | |
evoked_l_aud = evoked[0] |
This file contains 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 | |
def computeIntegrationPoints(h, acc, base=None, shape='circle'): | |
# These coil definitions make use of integration points according to the | |
# last formula in section 25.4.62 in the "Handbook of Mathematical | |
# Functions: With Formulas, Graphs, and Mathematical Tables" | |
# edited by Abramowitz and Stegun. | |
# http://people.math.sfu.ca/~cbm/aands/abramowitz_and_stegun.pdf |
This file contains 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 pylab as pl | |
import mne | |
from mne.datasets import sample | |
from mne.fiff import Raw, pick_types | |
from mne.minimum_norm import apply_inverse_epochs, read_inverse_operator | |
import time | |
from guppy import hpy |