Skip to content

Commit

Permalink
Merge pull request #700 from arnaudbore/fix_warnings
Browse files Browse the repository at this point in the history
Fix warnings in distortion correction
  • Loading branch information
arnaudbore authored Mar 24, 2023
2 parents 2cc624f + 52112b9 commit 76338ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scilpy/preprocessing/distortion_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,23 @@ def create_multi_topup_index(bvals, mean, n_rev, b0_thr=0):
dw_clumps = dw_clumps[1:]

for s1, s2 in zip(b0_clumps[:len(dw_clumps)], dw_clumps):
if mean is "none":
if mean == "none":
index[s1] = np.arange(cnt, cnt + s1.stop - s1.start)
index[s2] = index[s1.stop - 1]
cnt += s1.stop - s1.start
elif mean is "cluster":
elif mean == "cluster":
index[s1] = index[s2] = cnt
cnt += 1
else:
raise ValueError('Undefined mean category for '
'index determination : {}'.format(mean))

if len(b0_clumps) > len(dw_clumps):
if mean is "none":
if mean == "none":
index[b0_clumps[-1]] = np.arange(
cnt, cnt + b0_clumps[-1].stop - b0_clumps[-1].start)
cnt += b0_clumps[-1].stop - b0_clumps[-1].start
elif mean is "cluster":
elif mean == "cluster":
index[b0_clumps[-1]] = cnt
cnt += 1
else:
Expand Down

0 comments on commit 76338ca

Please sign in to comment.