13
13
14
14
import nibabel as nib
15
15
from nibabel .cmdline import convert
16
- from nibabel .testing import test_data
16
+ from nibabel .testing import get_test_data
17
17
18
18
19
19
def test_convert_noop (tmp_path ):
20
- infile = test_data (fname = 'anatomical.nii' )
20
+ infile = get_test_data (fname = 'anatomical.nii' )
21
21
outfile = tmp_path / 'output.nii.gz'
22
22
23
23
orig = nib .load (infile )
@@ -31,7 +31,7 @@ def test_convert_noop(tmp_path):
31
31
assert converted .shape == orig .shape
32
32
assert converted .get_data_dtype () == orig .get_data_dtype ()
33
33
34
- infile = test_data (fname = 'resampled_anat_moved.nii' )
34
+ infile = get_test_data (fname = 'resampled_anat_moved.nii' )
35
35
36
36
with pytest .raises (FileExistsError ):
37
37
convert .main ([str (infile ), str (outfile )])
@@ -50,7 +50,7 @@ def test_convert_noop(tmp_path):
50
50
51
51
@pytest .mark .parametrize ('data_dtype' , ('u1' , 'i2' , 'float32' , 'float' , 'int64' ))
52
52
def test_convert_dtype (tmp_path , data_dtype ):
53
- infile = test_data (fname = 'anatomical.nii' )
53
+ infile = get_test_data (fname = 'anatomical.nii' )
54
54
outfile = tmp_path / 'output.nii.gz'
55
55
56
56
orig = nib .load (infile )
@@ -78,7 +78,7 @@ def test_convert_dtype(tmp_path, data_dtype):
78
78
],
79
79
)
80
80
def test_convert_by_extension (tmp_path , ext , img_class ):
81
- infile = test_data (fname = 'anatomical.nii' )
81
+ infile = get_test_data (fname = 'anatomical.nii' )
82
82
outfile = tmp_path / f'output.{ ext } '
83
83
84
84
orig = nib .load (infile )
@@ -102,7 +102,7 @@ def test_convert_by_extension(tmp_path, ext, img_class):
102
102
],
103
103
)
104
104
def test_convert_imgtype (tmp_path , ext , img_class ):
105
- infile = test_data (fname = 'anatomical.nii' )
105
+ infile = get_test_data (fname = 'anatomical.nii' )
106
106
outfile = tmp_path / f'output.{ ext } '
107
107
108
108
orig = nib .load (infile )
@@ -118,7 +118,7 @@ def test_convert_imgtype(tmp_path, ext, img_class):
118
118
119
119
120
120
def test_convert_nifti_int_fail (tmp_path ):
121
- infile = test_data (fname = 'anatomical.nii' )
121
+ infile = get_test_data (fname = 'anatomical.nii' )
122
122
outfile = tmp_path / f'output.nii'
123
123
124
124
orig = nib .load (infile )
0 commit comments