bids.layout.parse_file_entities

parse_file_entities(filename, entities=None, config=None, include_unmatched=False)[source]

Parse the passed filename for entity/value pairs.

Parameters:
  • filename (str) – The filename to parse for entity values

  • entities (list or None, optional) – An optional list of Entity instances to use in extraction. If passed, the config argument is ignored. Default is None.

  • config (str or bids.layout.models.Config or list or None, optional) – One or more bids.layout.models.Config objects or names of configurations to use in matching. Each element must be a bids.layout.models.Config object, or a valid bids.layout.models.Config name (e.g., ‘bids’ or ‘derivatives’). If None, all available configs are used. Default is None.

  • include_unmatched (bool, optional) – If True, unmatched entities are included in the returned dict, with values set to None. If False (default), unmatched entities are ignored.

Returns:

Keys are Entity names and values are the values from the filename.

Return type:

dict