Only loop over files that have subhject as an entity
@@ -309,14 +309,18 @@ class BIDSLayout(object):
set(
[(t.value, t.file.entities.get('subject'))
for t in
- self.session.query(Tag).filter_by(entity_name='session')])
+ self.session.query(Tag).filter_by(entity_name='session')
+ if t.file.entities.get('subject')
+ ])
)
n_runs = len(
set(
[(t.value, t.file.entities.get('subject'))
for t in
- self.session.query(Tag).filter_by(entity_name='run')])
+ self.session.query(Tag).filter_by(entity_name='run')
+ if t.file.entities.get('subject')
+ ])
)
root = self.root[-30:]
