Skip to content

Instantly share code, notes, and snippets.

View alexrockhill's full-sized avatar

Alex Rockhill alexrockhill

View GitHub Profile
@alexrockhill
alexrockhill / flat_map_brain.py
Created February 2, 2023 23:07
Pial surface, inflated brain, flat map video visualization
import os
import os.path as op
import numpy as np
import mne
import imageio
misc_path = mne.datasets.misc.data_path()
sample_path = mne.datasets.sample.data_path()
subjects_dir = sample_path / 'subjects'
subject = 'fsaverage'
@alexrockhill
alexrockhill / vector_stc.py
Last active March 14, 2024 18:27
Plot a vector time-frequency source time course
# -*- coding: utf-8 -*-
"""
.. _ex-inverse-dics-epochs:
=======================================================================
Compute source level time-frequency timecourses using a DICS beamformer
=======================================================================
In this example, a Dynamic Imaging of Coherent Sources (DICS)
:footcite:`GrossEtAl2001` beamformer is used to transform sensor-level
time-frequency objects to the source level. We will look at the event-related
synchronization (ERS) of beta band activity in the :ref:`somato dataset
@alexrockhill
alexrockhill / group_level_tfr_stc.py
Last active April 3, 2023 18:57
Plot group-level results using the time-frequency volume source estimate viewer
import os.path as op
import numpy as np
import mne
import mne_gui_addons
import autoreject
from mne.time_frequency import csd_tfr
fs_dir = mne.datasets.fetch_fsaverage(verbose=True)
subjects_dir = op.dirname(fs_dir)