Skip to content

Commit

Permalink
[FIX] Propagate TR to ref_image header (#207)
Browse files Browse the repository at this point in the history
* Keep TR in ref image header

* update dimension of io test
  • Loading branch information
dowdlelt authored and emdupre committed Jan 31, 2019
1 parent ebd3a93 commit 101ad21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tedana/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tedana/tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

0 comments on commit 101ad21

Please sign in to comment.