Skip to content

Commit 527400d

Browse files
committed
do not error on non-3d inputs
The `conform` function can be made more general in the future, and tests that error on non-3d inputs might signal to future developers that it should not be generalized.
1 parent 67ace2f commit 527400d

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

nibabel/cmdline/tests/test_conform.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,3 @@ def test_nondefault(tmpdir):
4848
assert c.shape == out_shape
4949
assert c.header.get_zooms() == voxel_size
5050
assert nib.orientations.aff2axcodes(c.affine) == tuple(orientation)
51-
52-
53-
@needs_scipy
54-
def test_non3d(tmpdir):
55-
infile = test_data(fname="functional.nii")
56-
outfile = tmpdir / "output.nii.gz"
57-
with pytest.raises(ValueError):
58-
main([str(infile), str(outfile)])

nibabel/tests/test_processing.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -443,14 +443,3 @@ def test_conform():
443443
assert c.dataobj.dtype.type == anat.dataobj.dtype.type
444444
assert aff2axcodes(c.affine) == ('L', 'P', 'I')
445445
assert isinstance(c, Nifti2Image)
446-
447-
# Error on non-3D arguments.
448-
with pytest.raises(ValueError):
449-
conform(anat, out_shape=(100, 100))
450-
with pytest.raises(ValueError):
451-
conform(anat, voxel_size=(2, 2))
452-
453-
# Error on non-3D images.
454-
func = nib.load(pjoin(DATA_DIR, 'functional.nii'))
455-
with pytest.raises(ValueError):
456-
conform(func)

0 commit comments

Comments
 (0)