xcp_d.utils.bids.get_entity

xcp_d.utils.bids.get_entity(filename, entity)[source]

Extract a given entity from a BIDS filename via string manipulation.

Parameters:
  • filename (str) – Path to the BIDS file.

  • entity (str) – The entity to extract from the filename.

Returns:

entity_value – The BOLD file’s entity value associated with the requested entity.

Return type:

str or None