Skip to content

Commit 40e4ed4

Browse files
committed
return real timecourse and hrf | correct stimulus normalization
1 parent 06248c8 commit 40e4ed4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

code/python/cni_toolbox/pRF.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def get_hrf(self):
139139
else:
140140
hrf = ifft(self.hrf_fft, axis = 0)[0:self.l_hrf]
141141

142-
return hrf
142+
return np.abs(hrf)
143143

144144
def get_stimulus(self):
145145
'''
@@ -164,7 +164,7 @@ def get_timecourses(self):
164164
predicted timecourses
165165
'''
166166

167-
return ifft(self.tc_fft, axis = 0)[0:self.n_samples, :]
167+
return np.abs(ifft(self.tc_fft, axis = 0)[0:self.n_samples, :])
168168

169169
def set_hrf(self, hrf):
170170
'''
@@ -208,12 +208,12 @@ def import_stimulus(self):
208208
self.w_stimulus,
209209
self.n_samples + self.l_hrf))
210210

211-
for idx, f in enumerate(files):
211+
for f in files:
212212
number = int(''.join([str(s) for s in f if s.isdigit()]))
213213
img = cv2.imread(f)
214214
self.stimulus[:, :, number] = img[:, :, 0]
215215

216-
mn = np.min(self.stimulus)
216+
mn = np.min(self.stimulus[:, :, ::self.n_samples])
217217
mx = np.max(self.stimulus)
218218
self.stimulus = (self.stimulus - mn) / (mx - mn)
219219

0 commit comments

Comments
 (0)