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
""" | |
Reference | |
--------- | |
[1] Mingzhou Ding, Yonghong Chen. Granger Causality: Basic Theory and Application | |
to Neuroscience.Elsevier Science, 7 February 2008. | |
""" | |
import scot | |
import numpy as np | |
from scipy import linalg | |
def compute_order(X, m_max): |
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
# Generate source_estimate from significant clusters | |
stc = summarize_clusters_stc(clu, p_thre, tstep=tstep, | |
tmin=tmin, vertices=fsave_vertices, | |
subject='fsaverage') | |
# Generate thresholded source estimate | |
stc_sub = stc.copy().mean() | |
data = np.zeros(stc_sub.data.shape) | |
data[:, 0] = stc.data[:, 0] | |
abs_data = abs(data) | |
abs_data[abs_data < thr] = 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Implements Partial Directed Coherence and Direct Transfer Function | |
using multi-trials' MVAR processes. | |
Reference | |
--------- | |
[1] Luiz A. Baccala and Koichi Sameshima. Partial directed coherence: | |
a new concept in neural structure determination. |
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 #################################################################### | |
import mne | |
import numpy as np | |
import os | |
#%% load group avg data ####################################################### | |
os.environ["SUBJECTS_DIR"] = \ | |
"/freesurfer/RH4-x86_64-R530/subjects" | |
src_path = \ | |
'/MNE-sample-data/subjects/fsaverage/bem/fsaverage-ico-5-src.fif'; |