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 8
8
#
9
9
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
10
10
11
+ import unittest
12
+
11
13
import pytest
12
14
13
15
import nibabel as nib
14
16
from nibabel .testing import test_data
15
17
from 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' )
16
22
17
23
24
+ @needs_scipy
18
25
def test_default (tmpdir ):
19
26
infile = test_data (fname = "anatomical.nii" )
20
27
outfile = tmpdir / "output.nii.gz"
@@ -26,6 +33,7 @@ def test_default(tmpdir):
26
33
assert nib .orientations .aff2axcodes (c .affine ) == ('R' , 'A' , 'S' )
27
34
28
35
36
+ @needs_scipy
29
37
def test_nondefault (tmpdir ):
30
38
infile = test_data (fname = "anatomical.nii" )
31
39
outfile = tmpdir / "output.nii.gz"
@@ -42,6 +50,7 @@ def test_nondefault(tmpdir):
42
50
assert nib .orientations .aff2axcodes (c .affine ) == tuple (orientation )
43
51
44
52
53
+ @needs_scipy
45
54
def test_non3d (tmpdir ):
46
55
infile = test_data (fname = "functional.nii" )
47
56
outfile = tmpdir / "output.nii.gz"
You can’t perform that action at this time.
0 commit comments