@@ -77,7 +77,7 @@ def __init__(self, parameters, hrf=None):
77
77
78
78
if hrf is not None :
79
79
self .l_hrf = hrf .shape [0 ]
80
- if hrf .ndim > 2 :
80
+ if hrf .ndim > 1 :
81
81
hrf = np .reshape (hrf , (self .l_hrf , self .n_total ))
82
82
self .hrf_fft = fft (np .vstack ((hrf ,
83
83
np .zeros ((self .n_samples ,
@@ -148,7 +148,7 @@ def set_hrf(self, hrf):
148
148
hemodynamic response function
149
149
'''
150
150
self .l_hrf = hrf .shape [0 ]
151
- if hrf .ndim > 2 :
151
+ if hrf .ndim > 1 :
152
152
hrf = np .reshape (hrf , (self .l_hrf , self .n_total ))
153
153
self .hrf_fft = fft (np .vstack ((hrf ,
154
154
np .zeros ((self .n_samples ,
@@ -160,16 +160,20 @@ def set_hrf(self, hrf):
160
160
axis = 0 )
161
161
162
162
def set_stimulus (self , stimulus ):
163
- self .stimulus = np .zeros ((self .n_samples + self .l_hrf ,
164
- self .n_total ))
163
+ '''
164
+ Parameters
165
+ ----------
166
+ stimulus : floating point array
167
+ '''
165
168
if stimulus .ndim == 3 :
166
- self .stimulus [ 0 : self . n_samples , :] = np .reshape (
169
+ self .stimulus = np .reshape (
167
170
stimulus , (self .r_stimulus ** 2 , self .n_samples ))
168
171
else :
169
- self .stimulus [0 :self .n_samples , :] = stimulus
172
+ self .stimulus = stimulus
173
+ self .stimulus = np .hstack ((self .stimulus ,
174
+ np .zeros ((self .r_stimulus ** 2 , self .l_hrf ))))
170
175
171
176
def import_stimulus (self ):
172
-
173
177
root = tk .Tk ()
174
178
stimulus_directory = '' .join (filedialog .askdirectory (
175
179
title = 'Please select the stimulus directory' ))
@@ -382,6 +386,9 @@ def mapping(self, data, threshold=100, mask=[]):
382
386
self .slope [self .idx [idx_best , 2 ]]
383
387
384
388
i = int (m / n_voxels * 21 )
389
+ sys .stdout .write ('\r ' )
390
+ sys .stdout .write ("[%-20s] %d%%"
391
+ % ('=' * i , 5 * i ))
385
392
386
393
for key in results :
387
394
results [key ] = np .squeeze (
0 commit comments