Skip to content

Commit 75fb018

Browse files
committed
FIX: fix VisibleDepricationWarning due to incorrect boolean index length in test_parrec2nii_with_data
1 parent feb72f7 commit 75fb018

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

nibabel/tests/test_scripts.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ def test_parrec2nii_with_data():
283283
# Writes bvals, bvecs files if asked
284284
run_command(['parrec2nii', '--overwrite', '--keep-trace',
285285
'--bvs', dti_par])
286-
assert_almost_equal(np.loadtxt('DTI.bvals'), DTI_PAR_BVALS)
286+
bvecs_trace = np.loadtxt('DTI.bvecs').T
287+
bvals_trace = np.loadtxt('DTI.bvals')
288+
assert_almost_equal(bvals_trace, DTI_PAR_BVALS)
287289
img = load('DTI.nii')
288290
data = img.get_data().copy()
289291
del img
@@ -317,8 +319,8 @@ def test_parrec2nii_with_data():
317319
assert_equal(data_notrace.shape[-1], len(bvecs_notrace))
318320
del img
319321
# ensure correct volume was removed
320-
good_mask = np.logical_or((bvecs_notrace != 0).any(axis=1),
321-
bvals_notrace == 0)
322+
good_mask = np.logical_or((bvecs_trace != 0).any(axis=1),
323+
bvals_trace == 0)
322324
assert_almost_equal(data_notrace, data[..., good_mask])
323325
assert_almost_equal(bvals_notrace, np.array(DTI_PAR_BVALS)[good_mask])
324326
assert_almost_equal(bvecs_notrace, bvecs_LAS[good_mask])

0 commit comments

Comments
 (0)