bidslayout repor
@@ -102,6 +102,17 @@ class BIDSLayout(Layout):
dynamic_getters=True, include=include,
exclude=exclude, **kwargs)
+ def __repr__(self):
+ n_sessions = len([session for isub in self.get_subjects()
+ for session in self.get_sessions(subject=isub)])
+ n_runs = len([run for isub in self.get_subjects()
+ for run in self.get_runs(subject=isub)])
+ n_subjects = len(self.get_subjects())
+ root = self.root[-30:]
+ s = "BIDS Layout: ...{} | Subjects: {} | Sessions: {} | Runs: {}".format(
+ root, n_subjects, n_sessions, n_runs)
+ return s
+
def _validate_file(self, f):
# If validate=True then checks files according to BIDS and
# returns False if file doesn't fit BIDS specification
