Commit 33640abf authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

BF: isBIDSFile should return boolean

parent a7543878
...@@ -150,7 +150,7 @@ def isBIDSFile(filename, strict=True): ...@@ -150,7 +150,7 @@ def isBIDSFile(filename, strict=True):
name = op.basename(filename) name = op.basename(filename)
pattern = r'([a-z0-9]+-[a-z0-9]+_)*([a-z0-9])+\.(nii|nii\.gz|json)' pattern = r'([a-z0-9]+-[a-z0-9]+_)*([a-z0-9])+\.(nii|nii\.gz|json)'
flags = re.ASCII | re.IGNORECASE flags = re.ASCII | re.IGNORECASE
match = re.fullmatch(pattern, name, flags) match = re.fullmatch(pattern, name, flags) is not None
return ((not strict) or inBIDSDir(filename)) and match return ((not strict) or inBIDSDir(filename)) and match
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment