Skip to content

Commit 9b123f6

Browse files
committed
changes as commented
2 parents 833b4df + 018eceb commit 9b123f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

nibabel/cmdline/diff.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ def get_data_diff(files, max_abs=0, max_rel=0):
164164
diffs1 = [None] * (i + 1)
165165

166166
for j, d2 in enumerate(data[i + 1:], i + 1):
167+
167168
abs_diff = np.abs(d1 - d2)
168169
mean_abs = (np.abs(d1) + np.abs(d2)) * 0.5
169170
candidates = np.logical_or(mean_abs != 0, abs_diff != 0)
@@ -186,16 +187,20 @@ def get_data_diff(files, max_abs=0, max_rel=0):
186187
max_rel_diff = 0
187188

188189
if np.any(candidates):
190+
189191
diff_rec = OrderedDict() # so that abs goes before relative
192+
190193
diff_rec['abs'] = max_abs_diff
191194
diff_rec['rel'] = max_rel_diff
192195
diffs1.append(diff_rec)
193196
else:
194197
diffs1.append(None)
195198

196199
if any(diffs1):
200+
197201
diffs['DATA(diff %d:)' % (i + 1)] = diffs1
198202

203+
199204
return diffs
200205

201206

0 commit comments

Comments
 (0)