Skip to content

Instantly share code, notes, and snippets.

View dengemann's full-sized avatar

Denis A. Engemann dengemann

View GitHub Profile
# Authors: Denis Engemann <d.engemann@fz-juelich.de>
#
# License: BSD (3-clause)
import pandas as pd
import numpy as np
import StringIO
import os.path as op
# Authors: Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import glob
from subprocess import call
import mne
subjects = [
'foo',
# Author: Denis A. Engemann <d.engemann@fz-juelich.de>
#
# License: BSD (3-clause)
""" Profile FastICA options
Dependencies
------------
scikit-learn
https://github.com/fabianp/memory_profiler
import glob
import os
import os.path as op
import pandas as pd
import numpy as np
import h5py
test_fname = 'logfiles_controls/subject-*.hdf5'
import mne
from mne.preprocessing import ICA
from mne.datasets import sample
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif'
n_components=None
max_pca_components=None
raw = mne.fiff.Raw(raw_fname, preload=True)
lout ="""E1 71.9872 33.5519 -12.4579
E2 66.5644 42.5133 8.59
E3 58.0961 49.3772 28.2045
E4 48.6026 53.9002 46.916
E5 36.05 49.8077 64.9877
E6 21.8467 38.7535 78.4805
E7 10.7682 25.583 89.0865
E8 -1.3975 8.9851 93.8693
E9 -13.1647 -12.1274 96.6725
E10 61.5573 53.2255 -4.7359
"""
=========================================================
Time frequency : Induced power and inter-trial phase-lock
=========================================================
This script shows how to compute induced power and inter-trial
phase-lock for a list of epochs read in a raw file given
a list of events.
Specifically a CWT (Morlet) approach is compared to the
S transform that can be computed without specifying the lenght
import matplotlib.pyplot as plt
import numpy as np
from mne.time_frequency.tfr import _time_frequency, single_trial_power
from mne.time_frequency import morlet
#Initial discrete temporal signal:
delta = 0.001 # time sampling (in sec)
nbTrials = 1
times = np.arange(0, 1, delta)
# Author : denis.engemann@gmail.com
# simplified BSD-3 license
import numpy as np
import matplotlib.pyplot as plt
import mne
def plot_gfp(evokeds, title='Global Field Powe', gfp_func=None,
figsize=(14, 6)):
# Author: Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import mne
def concatante_runs(raw_fnames, event_fnames, allow_maxshield=False,
preload=False, proj=False, compensation=None,
add_eeg_ref=True, verbose=None):