def get_file(self, filename, scope='all'):
        ''' Returns the BIDSFile object with the specified path.

        Args:
            filename (str): The path of the file to retrieve. Must be either
                an absolute path, or relative to the root of this BIDSLayout.
            scope (str, list): Scope of the search space. If passed, only
                BIDSLayouts that match the specified scope will be
                searched. See BIDSLayout docstring for valid values.

        Returns: A BIDSFile, or None if no match was found.
        '''
        filename = os.path.abspath(os.path.join(self.root, filename))
        layouts = self._get_layouts_in_scope(scope)
        for ly in layouts:
            if filename in ly.files:
                return ly.files[filename]
        return None
Returns the BIDSFile object with the specified path.

        Args:
            filename (str): The path of the file to retrieve. Must be either
                an absolute path, or relative to the root of this BIDSLayout.
            scope (str, list): Scope of the search space. If passed, only
                BIDSLayouts that match the specified scope will be
                searched. See BIDSLayout docstring for valid values.

        Returns: A BIDSFile, or None if no match was found.