|
35 | 35 | # |
36 | 36 | # This file (compute_meg_auditory.py) was created on June 7, 2015. |
37 | 37 | # |
38 | | -# Based on Sanz-Leon et al (2015) and Sarvas (1987) and on TVB's monitors.py |
39 | | -# |
40 | 38 | # Author: Antonio Ulloa |
41 | 39 | # |
42 | | -# Last updated by Antonio Ulloa on December 14 2015 |
| 40 | +# Last updated by Antonio Ulloa on March 15 2016 |
43 | 41 | # **************************************************************************/ |
44 | 42 |
|
45 | 43 | # compute_meg_auditory.py |
|
50 | 48 | import numpy as np |
51 | 49 | import matplotlib.pyplot as plt |
52 | 50 |
|
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') |
75 | 54 |
|
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') |
80 | 59 |
|
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') |
83 | 62 |
|
84 | 63 | # 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') |
89 | 68 |
|
90 | 69 | # Extract number of timesteps from one of the synaptic activity arrays |
91 | | -synaptic_timesteps = ev1h.shape[0] |
| 70 | +synaptic_timesteps = ea1u.shape[0] |
92 | 71 |
|
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 |
94 | 73 | # 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) |
102 | 78 |
|
103 | 79 | # Set up figure to plot MEG source dynamics |
104 | 80 | plt.figure(1) |
105 | 81 |
|
106 | 82 | plt.suptitle('SIMULATED MEG SOURCE DYNAMICS') |
107 | 83 |
|
108 | 84 | # 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') |
116 | 89 |
|
117 | 90 | plt.legend() |
118 | 91 |
|
|
0 commit comments