Skip to content

Commit

Permalink
Merge pull request #115 from emdupre/num-vol
Browse files Browse the repository at this point in the history
[FIX] Explicitly strip extensions
  • Loading branch information
emdupre authored Aug 21, 2018
2 parents 645f277 + 61de1fb commit 2572ae4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tedana/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ def test_load_data():
# list of filepath to images
d, ref = utils.load_data(fnames, n_echos=len(tes))
assert d.shape == exp_shape
assert isinstance(ref, str)
assert ref == fnames[0]
assert isinstance(ref, nib.Nifti1Image)
assert np.allclose(ref.get_data(), nib.load(fnames[0]).get_data())

# list of img_like
d, ref = utils.load_data(fimg, n_echos=len(tes))
Expand Down
4 changes: 3 additions & 1 deletion tedana/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ def load_data(data, n_echos=None):
'{}'.format(data))
else: # individual echo files were provided (surface or volumetric)
fdata = np.stack([load_image(f) for f in data], axis=1)
return np.atleast_3d(fdata), data[0]
ref_img = check_niimg(data[0])
ref_img.header.extensions = []
return np.atleast_3d(fdata), ref_img

img = check_niimg(data)
(nx, ny), nz = img.shape[:2], img.shape[2] // n_echos
Expand Down

0 comments on commit 2572ae4

Please sign in to comment.