Skip to content

Commit 6b05696

Browse files
committed
fixed check for NANs and INFs
1 parent 5dc0463 commit 6b05696

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

code/python/cni_tlbx/IRM.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def mapping(self, data, threshold = 100, mask = []):
259259
v = voxel_index[m]
260260

261261
CS = np.matmul(tc, data[:, v]) / (mag_tc * mag_d[m])
262-
idx_remove = (CS == np.Inf)| (CS == np.NaN);
262+
idx_remove = (np.isinf(CS))| (np.isnan(CS))
263263
CS[idx_remove] = 0
264264

265265
results['corr_fit'][v] = np.max(CS)

code/python/cni_tlbx/pRF.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def mapping(self, data, threshold=100, mask=[]):
341341
v = voxel_index[m]
342342

343343
CS = np.matmul(tc, data[:, m]) / (mag_tc * mag_d[m])
344-
idx_remove = (CS == np.Inf) | (CS == np.NaN)
344+
idx_remove = idx_remove = (np.isinf(CS))| (np.isnan(CS))
345345
CS[idx_remove] = 0
346346

347347
results['corr_fit'][v] = np.max(CS)

0 commit comments

Comments
 (0)