@@ -181,25 +181,26 @@ def create_timecourses(self, FUN, xdata):
181
181
for idx , key in enumerate (self .xdata ):
182
182
n_observations [idx ] = np .size (self .xdata [key ])
183
183
184
- self .n_points = np .prod (n_observations )
184
+ self .n_points = np .prod (n_observations ). astype ( int )
185
185
186
186
idx_all = np .arange (self .n_points )
187
187
self .idx = np .zeros ((self .n_points , self .n_predictors ))
188
188
189
189
for p in range (self .n_predictors ):
190
190
self .idx [:, p ] = (idx_all // (np .prod (n_observations [p + 1 ::]))) \
191
191
% n_observations [p ]
192
-
192
+ self . idx = self . idx . astype ( int )
193
193
tc = np .zeros ((self .n_samples + self .l_hrf ,
194
194
self .n_points ))
195
195
x = np .zeros (self .n_predictors )
196
+ print ('\n creating timecourses' )
196
197
for j in range (self .n_points ):
197
- for p , key in enumerate (self .n_predictors ):
198
- x [p ] = self .xdata [key ]( self .idx [j , p ])
198
+ for p , key in enumerate (self .xdata ):
199
+ x [p ] = self .xdata [key ][ self .idx [j , p ]]
199
200
tc [0 :self .n_samples , j ] = FUN (self .stimulus , x )
200
201
i = int (j / self .n_points * 21 )
201
202
sys .stdout .write ('\r ' )
202
- sys .stdout .write ("creating timecourses [%-20s] %d%%"
203
+ sys .stdout .write ("[%-20s] %d%%"
203
204
% ('=' * i , 5 * i ))
204
205
205
206
self .tc_fft = fft (tc , axis = 0 )
@@ -241,7 +242,9 @@ def mapping(self, data, threshold = 100, mask = []):
241
242
242
243
243
244
results = {'corr_fit' : np .zeros (self .n_total )}
244
-
245
+ for key in self .xdata :
246
+ results [key ] = np .zeros (self .n_total )
247
+
245
248
if self .hrf_fft .ndim == 1 :
246
249
tc = np .transpose (
247
250
zscore (
@@ -251,6 +254,7 @@ def mapping(self, data, threshold = 100, mask = []):
251
254
axis = 1 ), axis = 0 )), axis = 0 ))
252
255
tc = tc [:, 0 :self .n_samples ]
253
256
mag_tc = np .sqrt (np .sum (tc ** 2 , axis = 1 ))
257
+ print ('\n mapping model parameters' )
254
258
for m in range (n_voxels ):
255
259
v = voxel_index [m ]
256
260
@@ -266,7 +270,7 @@ def mapping(self, data, threshold = 100, mask = []):
266
270
267
271
i = int (m / n_voxels * 21 )
268
272
sys .stdout .write ('\r ' )
269
- sys .stdout .write ("irm mapping [%-20s] %d%%"
273
+ sys .stdout .write ("[%-20s] %d%%"
270
274
% ('=' * i , 5 * i ))
271
275
272
276
else :
@@ -295,7 +299,7 @@ def mapping(self, data, threshold = 100, mask = []):
295
299
296
300
i = int (m / n_voxels * 21 )
297
301
sys .stdout .write ('\r ' )
298
- sys .stdout .write ("irm mapping [%-20s] %d%%"
302
+ sys .stdout .write ("[%-20s] %d%%"
299
303
% ('=' * i , 5 * i ))
300
304
301
305
@@ -306,4 +310,4 @@ def mapping(self, data, threshold = 100, mask = []):
306
310
self .n_cols ,
307
311
self .n_slices )))
308
312
309
- return results
313
+ return results
0 commit comments