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 | |
def _create_filter_response(sfreq, lowpass, highpass, lowpass_width=5., | |
highpass_width=0.5): | |
"""Create a frequency response""" | |
filter_size = 4096 | |
filter_taper_size = 2048 | |
resp_size = (filter_size + 2 * filter_taper_size) // 2 + 1 |
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 mne | |
def dipole_fwhm(dip, tmin=None, tmax=None, gof_thresh=0.): | |
"""Compute the time interval of full-width half-maximum of a dipole | |
.. note:: This only considers the max(), not the min(), so if you're | |
interested in large negative values, you could do | |
``dip.data = -dip.data``. | |
Parameters |
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 copy import deepcopy | |
import mne | |
from mne.bem import _fit_sph_harm_to_headshape, _transform_sph | |
from mne.surface import _tessellate_sphere_surf | |
raw = mne.io.read_raw_fif(mne.datasets.sample.data_path() + | |
'/MEG/sample/sample_audvis_raw.fif') | |
# For a visual explanation of the order, see: |
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 utmp | |
import tabulate | |
from warnings import warn | |
def time_str(dt): | |
"""Convert datetime object to date-time string.""" | |
return dt.strftime('%Y/%m/%d %H:%M:%S') |
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 -*- | |
""" | |
PySurfer-like plotting using VisPy scene. | |
""" | |
import numpy as np | |
from vispy import scene, app | |
import mne | |
import nibabel |
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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.signal import butter, lfilter | |
from scipy import linalg | |
from scipy.fftpack import fft, ifft | |
import mne |
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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Fri Dec 30 16:03:52 2016 | |
@author: larsoner | |
""" | |
import numpy as np | |
from mne.decoding import ReceptiveField |
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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
import numpy as np | |
from scipy.signal import firwin, firwin2, freqz | |
from scipy.io import loadmat | |
import matplotlib.pyplot as plt |
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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
""" | |
Manually enter MGH 70- and 60-channel cap names and convert to montages. | |
""" | |
from pathlib import Path | |
import numpy as np | |
import mne |
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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
""" | |
Use glass brain plotting for surface STCs. | |
""" | |
import os.path as op | |
import numpy as np | |
from scipy import sparse | |
import mne |