Skip to content
Snippets Groups Projects
Commit 255baae6 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

Clean up looksLikeImage

parent c0372b8d
No related branches found
No related tags found
No related merge requests found
...@@ -1332,12 +1332,10 @@ def looksLikeImage(filename, allowedExts=None): ...@@ -1332,12 +1332,10 @@ def looksLikeImage(filename, allowedExts=None):
extensions - defaults to :attr:`ALLOWED_EXTENSIONS`. extensions - defaults to :attr:`ALLOWED_EXTENSIONS`.
""" """
if allowedExts is None: allowedExts = ALLOWED_EXTENSIONS if allowedExts is None:
allowedExts = ALLOWED_EXTENSIONS
# TODO A much more robust approach would be return fslpath.hasExt(filename, allowedExts)
# to try loading the file using nibabel.
return any([filename.endswith(ext) for ext in allowedExts])
def addExt(prefix, mustExist=True, unambiguous=True): def addExt(prefix, mustExist=True, unambiguous=True):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment