laion_fmri.group

Multi-subject Group wrapper for cross-subject analyses.

Functions

load_subjects(subjects)

Load multiple subjects into a Group.

laion_fmri.group.load_subjects(subjects)[source]

Load multiple subjects into a Group.

Parameters:

subjects (list[str | int] or "all") – List of subject identifiers, or "all" to load every subject in the dataset.

Return type:

Group

Classes

Group(subjects_dict)

Holds several Subject instances and dispatches to them.

class laion_fmri.group.Group(subjects_dict)[source]

Bases: object

Holds several Subject instances and dispatches to them.

Parameters:

subjects_dict (dict[str, Subject]) – Mapping of BIDS ID to Subject.

get_shared_betas(session, roi=None, mask=None, nc_threshold=None)[source]

Load shared-stimulus single-trial betas for all subjects.

Parameters:
  • session (str) – BIDS session ID. Required – single-trial betas are stored per session.

  • roi (str or None)

  • mask (np.ndarray[bool] or None)

  • nc_threshold (float or None)

Returns:

Mapping of subject ID to a betas array of shape (n_shared_trials, n_voxels).

Return type:

dict[str, np.ndarray]

get_shared_images(format='pil')[source]

Load shared stimulus images from the first subject.

get_shared_stimulus_metadata()[source]

Return the shared subset of the stimulus-metadata TSV.