In [5]:
import mne
import numpy as np
from glob import glob
import matplotlib.pyplot as plt
In [6]:
%matplotlib inline
plt.style.use("seaborn")
In [7]:
# paths
snr_path = "/Volumes/projects/MINDLAB2016_MEG-Language-PD-DBS/scratch/mje/hilbert_data/hilbert_mne/snr/"
epochs_path = "/Volumes/projects/MINDLAB2016_MEG-Language-PD-DBS/scratch/mje/hilbert_data/hilbert_epochs/"
In [9]:
epochs = mne.read_epochs(epochs_path + "0010_Alpha_ds_ica-epo.fif", preload=False)
times = epochs.times * 1e3
In [10]:
%pylab inline
pylab.rcParams['figure.figsize'] = (15, 10)
In [11]:
band = "Alpha"
files_meg = glob(snr_path + "*_%s_snr_meg.npy" % band)
files_meg.sort()
files_full = glob(snr_path + "*_%s_snr_full.npy" % band)
files_full.sort()
files_est_meg = glob(snr_path + "*_%s_snr_est_meg.npy" % band)
files_est_meg.sort()
files_est_full = glob(snr_path + "*_%s_snr_est_full.npy" % band)
files_est_full.sort()
snr_meg = np.asarray([np.load(f) for f in files_meg])
snr_full = np.asarray([np.load(f) for f in files_full])
snr_est_meg = np.asarray([np.load(f) for f in files_est_meg])
snr_est_full = np.asarray([np.load(f) for f in files_est_full])
plt.figure()
plt.subplot(2,1, 1)
plt.plot(times, snr_full.mean(axis=0), 'b', label="MEG + EEG", linewidth=3)
plt.plot(times, snr_meg.mean(axis=0), 'r', label="MEG only", linewidth=3)
plt.legend()
plt.subplot(2,1,2)
plt.plot(times, snr_est_full.mean(axis=0), 'b', label="EST: MEG + EEG", linewidth=3)
plt.plot(times, snr_est_meg.mean(axis=0), 'r', label="EST: MEG only", linewidth=3)
plt.legend()
Out[11]:
In [12]:
band = "Beta"
files_meg = glob(snr_path + "*_%s_snr_meg.npy" % band)
files_meg.sort()
files_full = glob(snr_path + "*_%s_snr_full.npy" % band)
files_full.sort()
files_est_meg = glob(snr_path + "*_%s_snr_est_meg.npy" % band)
files_est_meg.sort()
files_est_full = glob(snr_path + "*_%s_snr_est_full.npy" % band)
files_est_full.sort()
snr_meg = np.asarray([np.load(f) for f in files_meg])
snr_full = np.asarray([np.load(f) for f in files_full])
snr_est_meg = np.asarray([np.load(f) for f in files_est_meg])
snr_est_full = np.asarray([np.load(f) for f in files_est_full])
plt.figure()
plt.subplot(2,1, 1)
plt.plot(times, snr_full.mean(axis=0), 'b', label="MEG + EEG", linewidth=3)
plt.plot(times, snr_meg.mean(axis=0), 'r', label="MEG only", linewidth=3)
plt.legend()
plt.subplot(2,1,2)
plt.plot(times, snr_est_full.mean(axis=0), 'b', label="EST: MEG + EEG", linewidth=3)
plt.plot(times, snr_est_meg.mean(axis=0), 'r', label="EST: MEG only", linewidth=3)
plt.legend()
Out[12]:
In [13]:
band = "Gamma_low"
files_meg = glob(snr_path + "*_%s_snr_meg.npy" % band)
files_meg.sort()
files_full = glob(snr_path + "*_%s_snr_full.npy" % band)
files_full.sort()
files_est_meg = glob(snr_path + "*_%s_snr_est_meg.npy" % band)
files_est_meg.sort()
files_est_full = glob(snr_path + "*_%s_snr_est_full.npy" % band)
files_est_full.sort()
snr_meg = np.asarray([np.load(f) for f in files_meg])
snr_full = np.asarray([np.load(f) for f in files_full])
snr_est_meg = np.asarray([np.load(f) for f in files_est_meg])
snr_est_full = np.asarray([np.load(f) for f in files_est_full])
plt.figure()
plt.subplot(2,1, 1)
plt.plot(times, snr_full.mean(axis=0), 'b', label="MEG + EEG", linewidth=3)
plt.plot(times, snr_meg.mean(axis=0), 'r', label="MEG only", linewidth=3)
plt.legend()
plt.subplot(2,1,2)
plt.plot(times, snr_est_full.mean(axis=0), 'b', label="EST: MEG + EEG", linewidth=3)
plt.plot(times, snr_est_meg.mean(axis=0), 'r', label="EST: MEG only", linewidth=3)
plt.legend()
Out[13]:
In [14]:
band = "Gamma_high_1"
files_meg = glob(snr_path + "*_%s_snr_meg.npy" % band)
files_meg.sort()
files_full = glob(snr_path + "*_%s_snr_full.npy" % band)
files_full.sort()
files_est_meg = glob(snr_path + "*_%s_snr_est_meg.npy" % band)
files_est_meg.sort()
files_est_full = glob(snr_path + "*_%s_snr_est_full.npy" % band)
files_est_full.sort()
snr_meg = np.asarray([np.load(f) for f in files_meg])
snr_full = np.asarray([np.load(f) for f in files_full])
snr_est_meg = np.asarray([np.load(f) for f in files_est_meg])
snr_est_full = np.asarray([np.load(f) for f in files_est_full])
plt.figure()
plt.subplot(2,1, 1)
plt.plot(times, snr_full.mean(axis=0), 'b', label="MEG + EEG", linewidth=3)
plt.plot(times, snr_meg.mean(axis=0), 'r', label="MEG only", linewidth=3)
plt.legend()
plt.subplot(2,1,2)
plt.plot(times, snr_est_full.mean(axis=0), 'b', label="EST: MEG + EEG", linewidth=3)
plt.plot(times, snr_est_meg.mean(axis=0), 'r', label="EST: MEG only", linewidth=3)
plt.legend()
Out[14]:
In [15]:
band = "Gamma_high_2"
files_meg = glob(snr_path + "*_%s_snr_meg.npy" % band)
files_meg.sort()
files_full = glob(snr_path + "*_%s_snr_full.npy" % band)
files_full.sort()
files_est_meg = glob(snr_path + "*_%s_snr_est_meg.npy" % band)
files_est_meg.sort()
files_est_full = glob(snr_path + "*_%s_snr_est_full.npy" % band)
files_est_full.sort()
snr_meg = np.asarray([np.load(f) for f in files_meg])
snr_full = np.asarray([np.load(f) for f in files_full])
snr_est_meg = np.asarray([np.load(f) for f in files_est_meg])
snr_est_full = np.asarray([np.load(f) for f in files_est_full])
plt.figure()
plt.subplot(2,1, 1)
plt.plot(times, snr_full.mean(axis=0), 'b', label="MEG + EEG", linewidth=3)
plt.plot(times, snr_meg.mean(axis=0), 'r', label="MEG only", linewidth=3)
plt.legend()
plt.subplot(2,1,2)
plt.plot(times, snr_est_full.mean(axis=0), 'b', label="EST: MEG + EEG", linewidth=3)
plt.plot(times, snr_est_meg.mean(axis=0), 'r', label="EST: MEG only", linewidth=3)
plt.legend()
Out[15]:
In [ ]: