Restrict meta-data searching to files with suffixes
@@ -544,7 +544,6 @@ class BIDSLayout(Layout):
class MetadataIndex(object):
"""A simple dict-based index for key/value pairs in JSON metadata.
-
Args:
layout (BIDSLayout): The BIDSLayout instance to index.
"""
@@ -568,6 +567,9 @@ class MetadataIndex(object):
if f.path in self.file_index and not overwrite:
return
+ if 'suffix' not in f.entities: # Skip files without suffixes
+ return
+
md = self._get_metadata(f.path)
for md_key, md_val in md.items():
