Friday, June 6, 2014

Day 14: D'oh!

Notebook

Some potentially bad news today. I generated simulated cortical data and tested the amygdala activation,
which should be none. As you can see below, I do see amygdala activation with a similar time course to
the evoked data (for comparison, I plot the average signal across all channels). The reason I say this
potentially bad news is because I haven't yet figured out the magnitude of the amygdala signal.

Also, I've created a subfolder in my public github repository specifically for this project. In it there
are three scripts. If you have mne-python installed, you should be able to run the three scripts in
alphabetical order and get the generate all the files I'm working with and get the same results that I
get.

Have a good weekend!

In [1]:
%matplotlib inline
%load /Users/Alan/PythonEEG/gsoc-subcortical/spm_test_subcortical_on_simulated_data.py
In [3]:
import matplotlib.pyplot as plt
import mne
from mne.datasets import spm_face

mne.set_log_level(False)

# read in the data files
data_path = spm_face.data_path()
fname_string = data_path + '/MEG/spm/SPM_CTF_MEG_example_faces1_3D'
sim = mne.io.read_evokeds(fname_string + '-sim-ave.fif')[0]
inv = mne.minimum_norm.read_inverse_operator(fname_string + '-inv.fif')

# set some parameters for the inverse operator
snr = 5.0
lambda2 = 1.0 / snr ** 2

# apply inverse operator to simulated data
stc = mne.minimum_norm.apply_inverse(sim, inv, lambda2)

# plot the results
t = stc.times
x = stc.data[len(stc.vertno[0])+len(stc.vertno[1]):].mean(0)

plt.plot(t, x)
plt.show()
In [4]:
plt.plot(t, sim.data.mean(0))
plt.show()

No comments:

Post a Comment