Skip to content
This repository was archived by the owner on Jan 27, 2023. It is now read-only.

Commit f8bbe5a

Browse files
author
Antonio Ulloa
committed
Added MEG scripts and simulation scripts
1 parent 7961566 commit f8bbe5a

File tree

7 files changed

+829
-414
lines changed

7 files changed

+829
-414
lines changed

analysis/compute_meg_auditory.py

Lines changed: 24 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,9 @@
3535
#
3636
# This file (compute_meg_auditory.py) was created on June 7, 2015.
3737
#
38-
# Based on Sanz-Leon et al (2015) and Sarvas (1987) and on TVB's monitors.py
39-
#
4038
# Author: Antonio Ulloa
4139
#
42-
# Last updated by Antonio Ulloa on December 14 2015
40+
# Last updated by Antonio Ulloa on March 15 2016
4341
# **************************************************************************/
4442

4543
# compute_meg_auditory.py
@@ -50,69 +48,44 @@
5048
import numpy as np
5149
import matplotlib.pyplot as plt
5250

53-
#the magnetic constant = 1.25663706 × 10-6 m kg s-2 A-2 (H/m)
54-
mu_0 = 1.25663706e-6 #mH/mm
55-
56-
# define the hypothetical Talairach locations of each LSNM auditory module
57-
a1_loc = [48,-26,10]
58-
a2_loc = [62,-32,10]
59-
st_loc = [59,-17,4]
60-
pf_loc = [56,21,5]
61-
62-
63-
# initialize source positions
64-
r_0 = [a1_loc, a2_loc, it_loc, pf_loc]
65-
66-
#initialize vector from sources to sensor
67-
Q = simulator.connectivity.orientations
68-
69-
centre = numpy.mean(r_0, axis=0)[numpy.newaxis, :]
70-
radius = 1.01 * max(numpy.sqrt(numpy.sum((r_0 - centre)**2, axis=1)))
71-
72-
# Load V1 synaptic activity data files into a numpy array
73-
ev1h = np.loadtxt('../simulator/output/ev1h_signed_syn.out')
74-
ev1v = np.loadtxt('../simulator/output/ev1v__signed_syn.out')
51+
# Load A1 synaptic activity data files into a numpy array
52+
ea1u = np.loadtxt('ea1u_signed_syn.out')
53+
ea1d = np.loadtxt('ea1d_signed_syn.out')
7554

76-
# Load V4 synaptic activity data files into a numpy array
77-
ev4h = np.loadtxt('../simulator/output/ev4h_signed_syn.out')
78-
ev4c = np.loadtxt('../simulator/output/ev4c_signed_syn.out')
79-
ev4v = np.loadtxt('../simulator/output/ev4v_signed_syn.out')
55+
# Load A2 synaptic activity data files into a numpy array
56+
ea2u = np.loadtxt('ea2u_signed_syn.out')
57+
ea2c = np.loadtxt('ea2c_signed_syn.out')
58+
ea2d = np.loadtxt('ea2d_signed_syn.out')
8059

81-
# Load IT synaptic activity data files into a numpy array
82-
exss = np.loadtxt('../simulator/output/exss_signed_syn.out')
60+
# Load ST synaptic activity data files into a numpy array
61+
estg = np.loadtxt('estg_signed_syn.out')
8362

8463
# Load PFC synaptic activity data files into a numpy array
85-
efd1 = np.loadtxt('../simulator/output/efd1_signed_syn.out')
86-
efd2 = np.loadtxt('../simulator/output/efd2_signed_syn.out')
87-
exfs = np.loadtxt('../simulator/output/exfs_signed_syn.out')
88-
exfr = np.loadtxt('../simulator/output/exfr_signed_syn.out')
64+
efd1 = np.loadtxt('efd1_signed_syn.out')
65+
efd2 = np.loadtxt('efd2_signed_syn.out')
66+
exfs = np.loadtxt('exfs_signed_syn.out')
67+
exfr = np.loadtxt('exfr_signed_syn.out')
8968

9069
# Extract number of timesteps from one of the synaptic activity arrays
91-
synaptic_timesteps = ev1h.shape[0]
70+
synaptic_timesteps = ea1u.shape[0]
9271

93-
# add all units within each region (V1, V4, IT, D1, D2, FS, R) together across space to calculate
72+
# add all units within each region together across space to calculate
9473
# MEG source dynamics in each brain region
95-
v1 = np.sum(ev1h + ev1v, axis = 1)
96-
v4 = np.sum(ev4h + ev4c + ev4v, axis=1)
97-
it = np.sum(exss, axis = 1)
98-
d1 = np.sum(efd1, axis = 1)
99-
d2 = np.sum(efd2, axis = 1)
100-
fs = np.sum(exfs, axis = 1)
101-
fr = np.sum(exfr, axis = 1)
74+
a1 = np.sum(ea1u + ea1d, axis = 1)
75+
a2 = np.sum(ea2u + ea2c + ea2d, axis=1)
76+
st = np.sum(estg, axis = 1)
77+
pf = np.sum(efd1 + efd2 + exfs + exfr, axis = 1)
10278

10379
# Set up figure to plot MEG source dynamics
10480
plt.figure(1)
10581

10682
plt.suptitle('SIMULATED MEG SOURCE DYNAMICS')
10783

10884
# Plot MEG signal
109-
v1_plot=plt.plot(v1, label='V1')
110-
v4_plot=plt.plot(v4, label='V4')
111-
it_plot=plt.plot(it, label='IT')
112-
d1_plot=plt.plot(d1, label='D1')
113-
d2_plot=plt.plot(d2, label='D2')
114-
fs_plot=plt.plot(fs, label='FS')
115-
fr_plot=plt.plot(fr, label='FR')
85+
a1_plot=plt.plot(a1, label='A1')
86+
a2_plot=plt.plot(a2, label='A2')
87+
st_plot=plt.plot(st, label='ST')
88+
pf_plot=plt.plot(pf, label='PFC')
11689

11790
plt.legend()
11891

auditory_model/old_script_single_trial.txt

Lines changed: 0 additions & 224 deletions
This file was deleted.

auditory_model/script_to_replicate_Rong_2011.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def intertrial_interval(modules, script_params):
358358
# a specific simulation timestep
359359
simulation_events = {
360360

361-
# REST BLOCK OF 4400 TIMESTEPS
361+
# REST BLOCK OF 200 TIMESTEPS
362362
'0' : intertrial_interval,
363363

364364
####### FIRST BLOCK OF 4 DMS TRIALS (MATCH, MISMATCH, MISMATCH, MATCH)

0 commit comments

Comments
 (0)