braindecode.datasets.NEMARDataset#

class braindecode.datasets.NEMARDataset(dataset_id, subjects=None, sessions=None, tasks=None, runs=None, modalities=None, target_name=None)[source]#

Stream a dataset from the NEMAR Zarr serving copy.

NEMAR serves every converted recording of its datasets as a Zarr v3 store that can be read in slices over HTTP, without downloading the BIDS files [NEMARZarr]. Each channel group of each recording (one group per modality, e.g. eeg_250hz) becomes a RawDataset whose raw is lazy: building the dataset only downloads metadata, and samples are fetched the first time they are read, e.g. by create_windows_from_events() with preload=False and a data loader. Preprocessing that needs a whole recording (raw.load_data()) downloads that recording only.

Each read costs a round trip to the server, so streaming suits exploration and fine-tuning on a few hours of data. Training that reads many windows per second, such as self-supervised pre-training, is orders of magnitude faster from a local copy of the stores.

The serving copy is derived from the BIDS source: it is resampled to a rate set per modality (e.g. 250 Hz for EEG and MEG, the group name gives it) and stored as int16. Use BIDSDataset on the downloaded BIDS files when the original samples matter.

Added in version 1.9.

Parameters:
  • dataset_id (str) – NEMAR dataset identifier, e.g. "nm000132". Converted datasets are listed at https://zarr.nemar.org/catalog.json.

  • subjects (str | list[str] | None) – Keep only recordings with these BIDS entities. None keeps all.

  • sessions (str | list[str] | None) – Keep only recordings with these BIDS entities. None keeps all.

  • tasks (str | list[str] | None) – Keep only recordings with these BIDS entities. None keeps all.

  • runs (str | list[str] | None) – Keep only recordings with these BIDS entities. None keeps all.

  • modalities (str | list[str] | None) – Keep only channel groups of these modalities (e.g. "EEG", "IEEG", "EMG"). None keeps all.

  • target_name (str | tuple[str, ...] | None) – Name(s) of the description field(s) used as target.

References