|
69 | 69 |
|
70 | 70 | # the following ranges define the location of the nodes within a given ROI in Hagmann's brain. |
71 | 71 | # They were taken from the excel document: |
72 | | -# "Hagmann's Talairach Coordinates (obtained from TVB).xlsx" |
| 72 | +# "Location of visual LSNM modules within Connectome.xlsx" |
73 | 73 | # Extracted from The Virtual Brain Demo Data Sets |
74 | | -# Please note that arrays in Python start from zero so one does need to account for that and shift |
75 | | -# indices given by the above document by one location. |
76 | | -# Use 6 nodes within rPCAL including host node 345 |
77 | | -v1_loc = range(344, 350) # Hagmann's brain nodes included within V1 ROI |
78 | 74 |
|
79 | | -# Use 6 nodes within rFUS including host node 393 |
80 | | -v4_loc = range(390, 396) # Hagmann's brain nodes included within V4 ROI |
81 | | - |
82 | | -# Use 6 nodes within rPARH including host node 413 |
83 | | -it_loc = range(412, 418) # Hagmann's brain nodes included within IT ROI |
84 | | - |
85 | | -# Use 6 nodes within rRMF including host node 74 |
86 | | -d1_loc = range(73, 79) # Hagmann's brain nodes included within D1 ROI |
87 | | - |
88 | | -# Use 6 nodes within rPTRI including host node 41 |
89 | | -d2_loc = range(39, 45) # Hagmann's brain nodes included within D2 ROI |
90 | | - |
91 | | -# Use 6 nodes within rPOPE including host node 47 |
92 | | -fs_loc = range(47, 53) # Hagmann's brain nodes included within FS ROI |
93 | | - |
94 | | -# Use 6 nodes within rCMF including host node 125 |
95 | | -fr_loc = range(125, 131) # Hagmann's brain nodes included within FR ROI |
96 | | - |
97 | | -# Use 6 nodes within lPARH |
98 | | -lit_loc= range(911, 917) # Hagmann's brain nodes included within left IT ROI |
| 75 | +roi_dict = { |
| 76 | + 'rLOF' : range( 0, 19), |
| 77 | + 'rPORB' : range( 19, 25), |
| 78 | + 'rFP' : range( 25, 27), |
| 79 | + 'rMOF' : range( 27, 39), |
| 80 | + 'rPTRI' : range( 39, 47), |
| 81 | + 'rPOPE' : range( 47, 57), |
| 82 | + 'rRMF' : range( 57, 79), |
| 83 | + 'rSF' : range( 79, 125), |
| 84 | + 'rCMF' : range(125, 138), |
| 85 | + 'rPREC' : range(138, 174), |
| 86 | + 'rPARC' : range(174, 186), |
| 87 | + 'rRAC' : range(186, 190), |
| 88 | + 'rCAC' : range(190, 194), |
| 89 | + 'rPC' : range(194, 201), |
| 90 | + 'rISTC' : range(201, 209), |
| 91 | + 'rPSTC' : range(209, 240), |
| 92 | + 'rSMAR' : range(240, 256), |
| 93 | + 'rSP' : range(256, 283), |
| 94 | + 'rIP' : range(283, 311), |
| 95 | + 'rPCUN' : range(311, 334), |
| 96 | + 'rCUN' : range(334, 344), |
| 97 | + 'rPCAL' : range(344, 354), |
| 98 | + 'rLOCC' : range(354, 373), |
| 99 | + 'rLING' : range(373, 390), |
| 100 | + 'rFUS' : range(390, 412), |
| 101 | + 'rPARH' : range(412, 418), |
| 102 | + 'rENT' : range(418, 420), |
| 103 | + 'rTP' : range(420, 423), |
| 104 | + 'rIT' : range(423, 442), |
| 105 | + 'rMT' : range(442, 462), |
| 106 | + 'rBSTS' : range(462, 469), |
| 107 | + 'rST' : range(469, 497), |
| 108 | + 'rTT' : range(497, 500) |
| 109 | +} |
99 | 110 |
|
100 | 111 | # Load TVB nodes synaptic activity |
101 | 112 | tvb_synaptic = np.load("tvb_abs_syn.npy") |
102 | 113 |
|
103 | | -# Load TVB host node synaptic activities into separate numpy arrays |
104 | | -tvb_ev1 = tvb_synaptic[:, 0, v1_loc[0]:v1_loc[-1]+1, 0] |
105 | | -tvb_ev4 = tvb_synaptic[:, 0, v4_loc[0]:v4_loc[-1]+1, 0] |
106 | | -tvb_eit = tvb_synaptic[:, 0, it_loc[0]:it_loc[-1]+1, 0] |
107 | | -tvb_ed1 = tvb_synaptic[:, 0, d1_loc[0]:d1_loc[-1]+1, 0] |
108 | | -tvb_ed2 = tvb_synaptic[:, 0, d2_loc[0]:d2_loc[-1]+1, 0] |
109 | | -tvb_efs = tvb_synaptic[:, 0, fs_loc[0]:fs_loc[-1]+1, 0] |
110 | | -tvb_efr = tvb_synaptic[:, 0, fr_loc[0]:fr_loc[-1]+1, 0] |
111 | | -tvb_iv1 = tvb_synaptic[:, 1, v1_loc[0]:v1_loc[-1]+1, 0] |
112 | | -tvb_iv4 = tvb_synaptic[:, 1, v4_loc[0]:v4_loc[-1]+1, 0] |
113 | | -tvb_iit = tvb_synaptic[:, 1, it_loc[0]:it_loc[-1]+1, 0] |
114 | | -tvb_id1 = tvb_synaptic[:, 1, d1_loc[0]:d1_loc[-1]+1, 0] |
115 | | -tvb_id2 = tvb_synaptic[:, 1, d2_loc[0]:d2_loc[-1]+1, 0] |
116 | | -tvb_ifs = tvb_synaptic[:, 1, fs_loc[0]:fs_loc[-1]+1, 0] |
117 | | -tvb_ifr = tvb_synaptic[:, 1, fr_loc[0]:fr_loc[-1]+1, 0] |
118 | | - |
119 | | -# now extract synaptic activity in the contralateral IT |
120 | | -tvb_elit = tvb_synaptic[:, 0, lit_loc[0]:lit_loc[-1]+1, 0] |
121 | | -tvb_ilit = tvb_synaptic[:, 1, lit_loc[0]:lit_loc[-1]+1, 0] |
122 | | - |
123 | | -# add all units WITHIN each region together across space to calculate |
124 | | -# synaptic activity in EACH brain region |
125 | | -v1_syn = np.sum(tvb_ev1+tvb_iv1, axis=1) |
126 | | -v4_syn = np.sum(tvb_ev4+tvb_iv4, axis=1) |
127 | | -it_syn = np.sum(tvb_eit+tvb_iit, axis=1) |
128 | | -d1_syn = np.sum(tvb_ed1+tvb_id1, axis=1) |
129 | | -d2_syn = np.sum(tvb_ed2+tvb_id2, axis=1) |
130 | | -fs_syn = np.sum(tvb_efs+tvb_ifs, axis=1) |
131 | | -fr_syn = np.sum(tvb_efr+tvb_ifr, axis=1) |
132 | | - |
133 | | -# now, add unit across space in the contralateral IT |
134 | | -lit_syn = np.sum(tvb_elit + tvb_ilit, axis=1) |
135 | | - |
136 | | -# create a numpy array of timeseries |
137 | | -synaptic = np.array([v1_syn, v4_syn, it_syn, fs_syn, d1_syn, d2_syn, fr_syn, lit_syn]) |
| 114 | +# create a numpy array of synaptic time-series, with a number of elements defined |
| 115 | +# by the number of ROIs above and the number of time points in each synaptic time-series |
| 116 | +synaptic = np.empty([len(roi_dict), tvb_synaptic.shape[0]]) |
138 | 117 |
|
| 118 | +# Load TVB host node synaptic activities into separate numpy arrays |
| 119 | +idx=0 |
| 120 | +for roi in roi_dict: |
| 121 | + synaptic[idx] = np.sum(tvb_synaptic[:, 0, roi_dict[roi], 0] + # excitatory unit of ROI |
| 122 | + tvb_synaptic[:, 1, roi_dict[roi], 0], # inhibitory unit of ROI |
| 123 | + axis=1) |
| 124 | + idx = idx + 1 |
| 125 | + |
139 | 126 | # now, save all synaptic timeseries to a single file |
140 | 127 | np.save(syn_file, synaptic) |
141 | 128 |
|
142 | | -# Extract number of timesteps from one of the matrices |
143 | | -timesteps = v1_syn.shape[0] |
| 129 | +# Extract total number of timesteps from synaptic time-series |
| 130 | +timesteps = tvb_synaptic.shape[0] |
144 | 131 | print 'Timesteps = ', timesteps |
145 | 132 |
|
146 | 133 | # Construct a numpy array of timesteps (data points provided in data file) |
|
156 | 143 |
|
157 | 144 | # Set up figures to plot synaptic activity |
158 | 145 | plt.figure() |
159 | | -plt.suptitle('SIMULATED SYNAPTIC ACTIVITY IN V1') |
160 | | -plt.plot(t, v1_syn) |
161 | | -# Set up figures to plot synaptic activity |
162 | | -plt.figure() |
163 | | -plt.suptitle('SIMULATED SYNAPTIC ACTIVITY IN V4') |
164 | | -plt.plot(v4_syn) |
165 | | -# Set up figures to plot synaptic activity |
166 | | -plt.figure() |
167 | | -plt.suptitle('SIMULATED SYNAPTIC ACTIVITY IN IT') |
168 | | -plt.plot(it_syn) |
169 | | -# Set up figures to plot synaptic activity |
170 | | -plt.figure() |
171 | | -plt.suptitle('SIMULATED SYNAPTIC ACTIVITY IN FS') |
172 | | -plt.plot(fs_syn) |
173 | | -# Set up figures to plot synaptic activity |
174 | | -plt.figure() |
175 | | -plt.suptitle('SIMULATED SYNAPTIC ACTIVITY IN D1') |
176 | | -plt.plot(d1_syn) |
177 | | -# Set up figures to plot synaptic activity |
178 | | -plt.figure() |
179 | | -plt.suptitle('SIMULATED SYNAPTIC ACTIVITY IN D2') |
180 | | -plt.plot(d2_syn) |
181 | | -# Set up figures to plot synaptic activity |
182 | | -plt.figure() |
183 | | -plt.suptitle('SIMULATED SYNAPTIC ACTIVITY IN FR') |
184 | | -plt.plot(fr_syn) |
185 | | -# Set up figures to plot synaptic activity |
186 | | -plt.figure() |
187 | | -plt.suptitle('SIMULATED SYNAPTIC ACTIVITY IN LEFT IT') |
188 | | -plt.plot(lit_syn) |
| 146 | +plt.suptitle('SIMULATED SYNAPTIC ACTIVITY OF ONE ROI') |
| 147 | +plt.plot(t, synaptic[0]) |
189 | 148 |
|
190 | 149 | # Show the plots on the screen |
191 | 150 | plt.show() |
0 commit comments