get_subject_info#

brainsets.utils.bids_utils.get_subject_info(subject_id, participants_data)[source]#

Retrieve demographic information (age, sex) for a given subject from a participants DataFrame.

Parameters:
  • subject_id (str) – BIDS subject identifier (e.g., ‘sub-01’).

  • participants_data (DataFrame | None) – DataFrame of participants.tsv data. If None, returns None for both age and sex.

Return type:

dict[str, float | str | None]

Returns:

Dictionary with keys ‘age’ and ‘sex’, each mapping to the value or None if not found.