Skip to content

Commit 5e21f83

Browse files
committed
TST: Use existing random spatial data generation fixture in PET test
Use existing random spatial data generation fixture in PET data test for the sake of consistency.
1 parent dd0c6f1 commit 5e21f83

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test/test_data_pet.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@
3131
from nifreeze.data.pet import PET, from_nii
3232

3333

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)
3738
fname = tmp_path / "pet.nii.gz"
3839
img.to_filename(fname)
3940

@@ -74,9 +75,9 @@ def test_pet_set_transform_updates_motion_affines():
7475
assert aff is dataset.motion_affines[idx]
7576

7677

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
8081
img = nb.Nifti1Image(data, affine)
8182
fname = tmp_path / "pet.nii.gz"
8283
img.to_filename(fname)

0 commit comments

Comments
 (0)