Skip to content

Commit 4e985a7

Browse files
committed
TEST: Use MGHImage to avoid scipy dependency
1 parent d0a6425 commit 4e985a7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

nibabel/cmdline/tests/test_roi.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,12 @@ def test_lossless_slice_scaling(tmp_path):
8080

8181

8282
def test_lossless_slice_noscaling(tmp_path):
83-
fname = tmp_path / 'image.img'
84-
img = nb.AnalyzeImage(np.random.uniform(-20000, 20000, (5, 5, 5, 5)).astype("float32"),
85-
affine=np.eye(4))
86-
img.header.set_data_dtype("float32")
83+
fname = tmp_path / 'image.mgh'
84+
img = nb.MGHImage(np.random.uniform(-20000, 20000, (5, 5, 5, 5)).astype("float32"),
85+
affine=np.eye(4))
8786
img.to_filename(fname)
8887
img1 = nb.load(fname)
89-
sliced_fname = tmp_path / 'sliced.img'
88+
sliced_fname = tmp_path / 'sliced.mgh'
9089
lossless_slice(img1, (slice(None), slice(None), slice(2, 4))).to_filename(sliced_fname)
9190
img2 = nb.load(sliced_fname)
9291

0 commit comments

Comments
 (0)