Skip to content

Commit 2a8e2d6

Browse files
committed
TEST: Add regression test for fmriprep issue 2507
1 parent 5d08d91 commit 2a8e2d6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

niworkflows/interfaces/tests/test_bids.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,13 @@ def test_DerivativesDataSink_build_path(
308308

309309
for out, exp in zip(output, expectation):
310310
assert Path(out).relative_to(tmp_path) == Path(base) / exp
311+
# Regression - some images were given nan scale factors
312+
if out.endswith(".nii") or out.endswith(".nii.gz"):
313+
img = nb.load(out)
314+
with nb.openers.ImageOpener(out) as fobj:
315+
hdr = img.header.from_fileobj(fobj)
316+
assert not np.isnan(hdr["scl_slope"])
317+
assert not np.isnan(hdr["scl_inter"])
311318
for out, chksum in zip(output, checksum):
312319
assert sha1(Path(out).read_bytes()).hexdigest() == chksum
313320

0 commit comments

Comments
 (0)