get_entity_value
- bidsaid.files.get_entity_value(filename, entity, return_entity_prefix=False)[source]
Gets entity value of a BIDS compliant filename.
Parameters
- filename
strorPath Filename to extract entity from.
- entity
str The entity key (e.g. “sub”, “task”, etc).
- return_entity_prefix
bool, default=False Return value with the entity (“sub-101” instead of “101”) if True.
Returns
- str or None
The entity value with the entity prefix if
return_entity_prefixis True.
Example
>>> from bidsaid.files import get_entity_value >>> get_entity_value("sub-01_task-flanker_bold.nii.gz", "task") "flanker"
- filename