Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.

brainprep.utils.utils.check_run_fn

brainprep.utils.utils.check_run_fn(bids_path, entities, full_path=False)[source]

Scan the folder containing a BIDS file and verify that the run entity associated with the file appears exactly once among all matching files.

Parameters:
bids_pathFile

A BIDS file.

entitiesdict[str]

Dictionary of parsed BIDS entities for the file, including the modality.

full_pathbool

If True, extract entities from the full path instead of only the filename. Default False.

Returns:
bool

True if the run identifier occurs exactly once among all matching files in the folder (or zero for virtual data), False otherwise.