Skip to content

Better handle pathological filenames #621

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

Merged
merged 1 commit into from
Apr 24, 2018

Conversation

DimitriPapadopoulos
Copy link
Contributor

os.path.splitext() does not provide the behavior we need to properly
recognize edge cases such as .nii as image files.

Fixes #620

@codecov-io
Copy link

codecov-io commented Apr 19, 2018

Codecov Report

Merging #621 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #621      +/-   ##
==========================================
+ Coverage    90.3%   90.31%   +<.01%     
==========================================
  Files          87       87              
  Lines       10813    10816       +3     
  Branches     1793     1794       +1     
==========================================
+ Hits         9765     9768       +3     
  Misses        719      719              
  Partials      329      329
Impacted Files Coverage Δ
nibabel/filename_parser.py 91.46% <100%> (+0.32%) ⬆️

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 586c0e0...fc6a9c0. Read the comment docs.

@coveralls
Copy link

coveralls commented Apr 19, 2018

Coverage Status

Coverage increased (+0.002%) to 93.352% when pulling fc6a9c0 on DimitriPapadopoulos:master into 586c0e0 on nipy:master.

os.path.splitext() does not provide the behavior we need to properly
recognize edge cases such as '.nii' as image files.
@yarikoptic
Copy link
Member

Makes world a better place so merging (looks kosher on cursory review), Thanks!

@yarikoptic yarikoptic merged commit 68cf671 into nipy:master Apr 24, 2018
@lanranranM
Copy link

Hello, I'm using nib.load(file_name) to access a ".nii.gz" file, and the function raise ImageFileError and I found that nib.filebasedimages.FileBasedImage.path_maybe_image('.nii') still gives me a (False, None). How can I solve the problem? Thanks

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.

Cannot work out file type of ".nii"
5 participants