OpenNeuroDataset#

class brainsets.datasets.OpenNeuroDataset(root, dataset_dir, split_type, recording_ids=None, transform=None, uniquify_channel_ids_with_subject=False, uniquify_channel_ids_with_session=True, split_ratios=(0.8, 0.1, 0.1), seed=42, **kwargs)[source]#

Bases: MultiChannelDatasetMixin, Dataset

Base class for OpenNeuro datasets.

This class provides an interface for loading, representing, and manipulating OpenNeuro datasets using the MultiChannelDatasetMixin and the Dataset interface. It supports various splitting strategies for machine learning workflows, notably ‘intrasession’, ‘intersubject’, and ‘intersession’ splits.

Parameters:
  • root (str) – Root directory containing processed OpenNeuro dataset artifacts.

  • dataset_dir (str) – Relative dataset directory within the root path.

  • split_type (Literal['intrasession', 'intersubject', 'intersession']) – The split strategy to use, must be one of ‘intrasession’, ‘intersubject’, or ‘intersession’.

  • recording_ids (Optional[list[str]]) – List of recording IDs to include, or None to use all available recordings.

  • transform (Optional[Callable]) – Optional sample transform.

  • uniquify_channel_ids_with_subject (bool) – Whether to prefix channel IDs with subject.id via MultiChannelDatasetMixin. Defaults to False.

  • uniquify_channel_ids_with_session (bool) – Whether to prefix channel IDs with session.id via MultiChannelDatasetMixin. Defaults to True.

  • task_paradigm – The task paradigm of the dataset. Depends on the dataset. Defaults to None.

  • split_ratios (tuple[float, float, float]) – Tuple of three floats (train, val, test) whose sum must be 1.0. Specifies the proportion of the dataset to use for the train, validation, and test splits, respectively. All ratios must be in [0, 1] and their sum must be 1.0. If the sum does not equal 1.0, a ValueError is raised.

  • seed (int) – The seed for the random number generator. Used for computing splits in

  • 42. (intersubject and intersession mode. Defaults to)