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()

Thursday, June 5, 2014

Day 13: Surface or volume?

While I track down a bug in actually loading my simulated data from yesterday, I wanted to bring up another way of modelling sub-cortical structures. Another popular open source Matlab based application called Brainstorm, supports sub-cortical source localization by modelling sub-cortical structures as surfaces. Up until now, I've been modelling the amygdala as a volume and merging with the cortical surface, or modelling the whole brain as a volume.

Balderston et al. provide a video article using Brainstorm to look at amygdala activity. The video explicitly goes through the steps of recording and analyzing the data.

In addition, an MNE user from the University of Pennsylvania was kind enough to share his Python based implementation of modelling sub-cortical structures as surfaces. Another one of my goals this summer will be getting his code to work on the SPM face data set and comparing the results to my previous approaches.