|
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.random_uniform_spatial_data((2, 2, 2, 2), 0.0, 1.0) |
| 12 | +def test_from_nii_requires_frame_time(setup_random_uniform_spatial_data, tmp_path): |
| 13 | + data, affine = setup_random_uniform_spatial_data |
| 14 | + img = nb.Nifti1Image(data, affine) |
14 | 15 | fname = tmp_path / "pet.nii.gz"
|
15 | 16 | img.to_filename(fname)
|
16 | 17 |
|
@@ -51,9 +52,9 @@ def test_pet_set_transform_updates_motion_affines():
|
51 | 52 | assert aff is dataset.motion_affines[idx]
|
52 | 53 |
|
53 | 54 |
|
54 |
| -def test_pet_load(tmp_path): |
55 |
| - data = np.zeros((2, 2, 2, 2), dtype=np.float32) |
56 |
| - affine = np.eye(4) |
| 55 | +@pytest.mark.random_uniform_spatial_data((2, 2, 2, 2), 0.0, 1.0) |
| 56 | +def test_pet_load(setup_random_uniform_spatial_data, tmp_path): |
| 57 | + data, affine = setup_random_uniform_spatial_data |
57 | 58 | img = nb.Nifti1Image(data, affine)
|
58 | 59 | fname = tmp_path / "pet.nii.gz"
|
59 | 60 | img.to_filename(fname)
|
|
0 commit comments