|
8 | 8 | from nifreeze.data.pet import PET, from_nii
|
9 | 9 |
|
10 | 10 |
|
11 |
| -def test_from_nii_requires_frame_time(tmp_path): |
12 |
| - data = np.zeros((2, 2, 2, 2), dtype=np.float32) |
13 |
| - img = nb.Nifti1Image(data, np.eye(4)) |
| 11 | +@pytest.mark.parametrize( |
| 12 | + "setup_random_uniform_spatial_data", |
| 13 | + [ |
| 14 | + (2, 2, 2, 2, 0.0, 1.0), |
| 15 | + ], |
| 16 | +) |
| 17 | +def test_from_nii_requires_frame_time(setup_random_uniform_spatial_data, tmp_path): |
| 18 | + data, affine = setup_random_uniform_spatial_data |
| 19 | + img = nb.Nifti1Image(data, affine) |
14 | 20 | fname = tmp_path / "pet.nii.gz"
|
15 | 21 | img.to_filename(fname)
|
16 | 22 |
|
@@ -51,9 +57,14 @@ def test_pet_set_transform_updates_motion_affines():
|
51 | 57 | assert aff is dataset.motion_affines[idx]
|
52 | 58 |
|
53 | 59 |
|
54 |
| -def test_pet_load(tmp_path): |
55 |
| - data = np.zeros((2, 2, 2, 2), dtype=np.float32) |
56 |
| - affine = np.eye(4) |
| 60 | +@pytest.mark.parametrize( |
| 61 | + "setup_random_uniform_spatial_data", |
| 62 | + [ |
| 63 | + (2, 2, 2, 2, 0.0, 1.0), |
| 64 | + ], |
| 65 | +) |
| 66 | +def test_pet_load(setup_random_uniform_spatial_data, tmp_path): |
| 67 | + data, affine = setup_random_uniform_spatial_data |
57 | 68 | img = nb.Nifti1Image(data, affine)
|
58 | 69 | fname = tmp_path / "pet.nii.gz"
|
59 | 70 | img.to_filename(fname)
|
|
0 commit comments