From 101ad21ed1915e30b0e1afcfb992f3cb69abdf1e Mon Sep 17 00:00:00 2001 From: Logan Dowdle Date: Thu, 31 Jan 2019 10:51:17 -0500 Subject: [PATCH] [FIX] Propagate TR to ref_image header (#207) * Keep TR in ref image header * update dimension of io test --- tedana/io.py | 2 +- tedana/tests/test_io.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tedana/io.py b/tedana/io.py index 27ce47afc..cdb2bdd09 100644 --- a/tedana/io.py +++ b/tedana/io.py @@ -544,7 +544,7 @@ def load_data(data, n_echos=None): fdata = utils.load_image(img.get_data().reshape(nx, ny, nz, n_echos, -1, order='F')) # create reference image - ref_img = img.__class__(np.zeros((nx, ny, nz)), affine=img.affine, + ref_img = img.__class__(np.zeros((nx, ny, nz, 1)), affine=img.affine, header=img.header, extra=img.extra) ref_img.header.extensions = [] ref_img.header.set_sform(ref_img.header.get_sform(), code=1) diff --git a/tedana/tests/test_io.py b/tedana/tests/test_io.py index 2d39a85ed..ceeecfd37 100644 --- a/tedana/tests/test_io.py +++ b/tedana/tests/test_io.py @@ -42,7 +42,7 @@ def test_load_data(): d, ref = me.load_data(fnames[0], n_echos=3) assert d.shape == (21450, 3, 5) assert isinstance(ref, nib.Nifti1Image) - assert ref.shape == (39, 50, 11) + assert ref.shape == (39, 50, 11, 1) with pytest.raises(ValueError): me.load_data(fnames[0])