@@ -364,6 +364,9 @@ def _in_scope(self, scope):
364
364
def _get_layouts_in_scope (self , scope ):
365
365
''' Return all layouts in the passed scope. '''
366
366
367
+ if scope == 'self' :
368
+ return [self ]
369
+
367
370
def collect_layouts (layout ):
368
371
''' Recursively build a list of layouts '''
369
372
children = list (layout .derivatives .values ())
@@ -623,6 +626,7 @@ def get(self, return_type='object', target=None, scope='all',
623
626
'all' (default): search all available directories.
624
627
'derivatives': search all derivatives directories
625
628
'raw': search only BIDS-Raw directories
629
+ 'self': search only the directly called BIDSLayout
626
630
<PipelineName>: the name of a BIDS-Derivatives pipeline
627
631
regex_search (bool or None): Whether to require exact matching
628
632
(False) or regex search (True) when comparing the query string
@@ -844,8 +848,9 @@ def get_metadata(self, path, include_entities=False, scope='all'):
844
848
from the filename (rather than JSON sidecars) are included in
845
849
the returned metadata dictionary.
846
850
scope (str, list): The scope of the search space. Each element must
847
- be one of 'all', 'raw', 'derivatives', or a BIDS-Derivatives
848
- pipeline name. Defaults to searching all available datasets.
851
+ be one of 'all', 'raw', 'self', 'derivatives', or a
852
+ BIDS-Derivatives pipeline name. Defaults to searching all
853
+ available datasets.
849
854
850
855
Returns: A dictionary of key/value pairs extracted from all of the
851
856
target file's associated JSON sidecars.
@@ -872,7 +877,6 @@ def get_metadata(self, path, include_entities=False, scope='all'):
872
877
873
878
return {}
874
879
875
-
876
880
def get_nearest (self , path , return_type = 'filename' , strict = True ,
877
881
all_ = False , ignore_strict_entities = 'extension' ,
878
882
full_search = False , ** filters ):
0 commit comments