File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 88#
99### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
1010
11+ import unittest
12+
1113import pytest
1214
1315import nibabel as nib
1416from nibabel .testing import test_data
1517from nibabel .cmdline .conform import main
18+ from nibabel .optpkg import optional_package
19+
20+ _ , have_scipy , _ = optional_package ('scipy.ndimage' )
21+ needs_scipy = unittest .skipUnless (have_scipy , 'These tests need scipy' )
1622
1723
24+ @needs_scipy
1825def test_default (tmpdir ):
1926 infile = test_data (fname = "anatomical.nii" )
2027 outfile = tmpdir / "output.nii.gz"
@@ -26,6 +33,7 @@ def test_default(tmpdir):
2633 assert nib .orientations .aff2axcodes (c .affine ) == ('R' , 'A' , 'S' )
2734
2835
36+ @needs_scipy
2937def test_nondefault (tmpdir ):
3038 infile = test_data (fname = "anatomical.nii" )
3139 outfile = tmpdir / "output.nii.gz"
@@ -42,6 +50,7 @@ def test_nondefault(tmpdir):
4250 assert nib .orientations .aff2axcodes (c .affine ) == tuple (orientation )
4351
4452
53+ @needs_scipy
4554def test_non3d (tmpdir ):
4655 infile = test_data (fname = "functional.nii" )
4756 outfile = tmpdir / "output.nii.gz"
You can’t perform that action at this time.
0 commit comments