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 aRawDatasetwhose raw is lazy: building the dataset only downloads metadata, and samples are fetched the first time they are read, e.g. bycreate_windows_from_events()withpreload=Falseand 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
BIDSDataseton 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.Nonekeeps all.sessions (
str|list[str] |None) – Keep only recordings with these BIDS entities.Nonekeeps all.tasks (
str|list[str] |None) – Keep only recordings with these BIDS entities.Nonekeeps all.runs (
str|list[str] |None) – Keep only recordings with these BIDS entities.Nonekeeps all.modalities (
str|list[str] |None) – Keep only channel groups of these modalities (e.g."EEG","IEEG","EMG").Nonekeeps all.target_name (
str|tuple[str,...] |None) – Name(s) of the description field(s) used as target.
References
[NEMARZarr]NEMAR Zarr serving copy, https://docs.nemar.org/platform/zarr/