xcp_d.utils.bids.collect_participants

xcp_d.utils.bids.collect_participants(bids_dir, participant_label=None, strict=False, bids_validate=False)[source]

Collect a list of participants from a BIDS dataset.

Parameters:
  • bids_dir (str or pybids.layout.BIDSLayout)

  • participant_label (None or str, optional)

  • strict (bool, optional)

  • bids_validate (bool, optional)

Return type:

found_label

Examples

Requesting all subjects in a BIDS directory root: #>>> collect_participants(str(datadir / ‘ds114’), bids_validate=False) [‘01’, ‘02’, ‘03’, ‘04’, ‘05’, ‘06’, ‘07’, ‘08’, ‘09’, ‘10’]

Requesting two subjects, given their IDs: #>>> collect_participants(str(datadir / ‘ds114’), participant_label=[‘02’, ‘04’], #… bids_validate=False) [‘02’, ‘04’] …