diff --git a/fsl/utils/filetree/query.py b/fsl/utils/filetree/query.py index 3e273374750bd829eca39feae1f0a369c872bc53..49433fa546384f4ce4f03b95bf786ce0f6d64a95 100644 --- a/fsl/utils/filetree/query.py +++ b/fsl/utils/filetree/query.py @@ -149,6 +149,7 @@ class FileTreeQuery(object): tarr[tuple(idx)] = match + self.__tree = tree self.__allvars = allvars self.__templatevars = templatevars self.__matches = matches @@ -179,6 +180,14 @@ class FileTreeQuery(object): return {var : list(self.__allvars[var]) for var in varnames} + @property + def tree(self): + """Returns the :class:`.FileTree` associated with this + ``FileTreeQuery``. + """ + return self.__tree + + @property def templates(self) -> List[str]: """Returns a list containing all templates of the ``FileTree`` that