Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Explicitly strip extensions #115

Merged
merged 1 commit into from
Aug 21, 2018
Merged

[FIX] Explicitly strip extensions #115

merged 1 commit into from
Aug 21, 2018

Conversation

emdupre
Copy link
Member

@emdupre emdupre commented Aug 20, 2018

Closes #82.

Changes proposed in this pull request:

  • Reformats load_data to explicitly strip extensions for both zcat images and listed echo files

@emdupre
Copy link
Member Author

emdupre commented Aug 20, 2018

@rmarkello it'd be great to get your review, here !

@emdupre emdupre force-pushed the num-vol branch 3 times, most recently from 094e4c1 to 6794bf1 Compare August 20, 2018 20:53
Copy link
Member

@rmarkello rmarkello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the current set up might not work exactly as intended, but it's almost there! See my comment regarding the if-else clause and let me know if you have questions about it

return np.atleast_3d(fdata), data[0]
fdata = np.atleast_3d(fdata)
ref_img = check_niimg(data[0])
else:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will work as-is for z-concatenated images. The if isinstance(data, list) will always be triggered because of argparse, so the else clause here never will. I think we can get rid of this whole if-else block and move the code below this else section up under if len(data) == 1.

# create reference image
ref_img = img.__class__(np.zeros((nx, ny, nz)), affine=img.affine,
header=img.header, extra=img.extra)
ref_img.header.set_sform(ref_img.header.get_sform(), code=1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be moved back next to ref_img.header.extensions = [] so that it triggers regardless of the input data!

@emdupre emdupre force-pushed the num-vol branch 3 times, most recently from 7380280 to 3beb3d9 Compare August 20, 2018 21:21
@codecov
Copy link

codecov bot commented Aug 21, 2018

Codecov Report

Merging #115 into master will increase coverage by 0.14%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #115      +/-   ##
==========================================
+ Coverage   49.58%   49.72%   +0.14%     
==========================================
  Files          32       32              
  Lines        2033     2035       +2     
==========================================
+ Hits         1008     1012       +4     
+ Misses       1025     1023       -2
Impacted Files Coverage Δ
tedana/utils/utils.py 95.77% <100%> (+0.06%) ⬆️
tedana/tests/test_utils.py 100% <100%> (ø) ⬆️
tedana/workflows/t2smap.py 72.85% <0%> (+2.85%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 645f277...61de1fb. Read the comment docs.

@emdupre emdupre merged commit 2572ae4 into ME-ICA:master Aug 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants