|
31 | 31 | from nifreeze.data.pet import PET, from_nii
|
32 | 32 |
|
33 | 33 |
|
34 |
| -def test_from_nii_requires_frame_time(tmp_path): |
35 |
| - data = np.zeros((2, 2, 2, 2), dtype=np.float32) |
36 |
| - img = nb.Nifti1Image(data, np.eye(4)) |
| 34 | +@pytest.mark.random_uniform_spatial_data((2, 2, 2, 2), 0.0, 1.0) |
| 35 | +def test_from_nii_requires_frame_time(setup_random_uniform_spatial_data, tmp_path): |
| 36 | + data, affine = setup_random_uniform_spatial_data |
| 37 | + img = nb.Nifti1Image(data, affine) |
37 | 38 | fname = tmp_path / "pet.nii.gz"
|
38 | 39 | img.to_filename(fname)
|
39 | 40 |
|
@@ -74,9 +75,9 @@ def test_pet_set_transform_updates_motion_affines():
|
74 | 75 | assert aff is dataset.motion_affines[idx]
|
75 | 76 |
|
76 | 77 |
|
77 |
| -def test_pet_load(tmp_path): |
78 |
| - data = np.zeros((2, 2, 2, 2), dtype=np.float32) |
79 |
| - affine = np.eye(4) |
| 78 | +@pytest.mark.random_uniform_spatial_data((2, 2, 2, 2), 0.0, 1.0) |
| 79 | +def test_pet_load(setup_random_uniform_spatial_data, tmp_path): |
| 80 | + data, affine = setup_random_uniform_spatial_data |
80 | 81 | img = nb.Nifti1Image(data, affine)
|
81 | 82 | fname = tmp_path / "pet.nii.gz"
|
82 | 83 | img.to_filename(fname)
|
|
0 commit comments