braindecode.datautil package#

Utilities for data manipulation.

Submodules#

braindecode.datautil.mne module#

braindecode.datautil.preprocess module#

braindecode.datautil.serialization module#

Convenience functions for storing and loading of windows datasets.

braindecode.datautil.serialization.load_concat_dataset(path, preload, ids_to_load=None, target_name=None, n_jobs=1)[source]#

Load a stored BaseConcatDataset of BaseDatasets or WindowsDatasets from files.

Parameters:
  • path (str | pathlib.Path) – Path to the directory of the .fif / -epo.fif and .json files.

  • preload (bool) – Whether to preload the data.

  • ids_to_load (list of int | None) – Ids of specific files to load.

  • target_name (str | list | None) – Load specific description column as target. If not given, take saved target name.

  • n_jobs (int) – Number of jobs to be used to read files in parallel.

Returns:

concat_dataset

Return type:

BaseConcatDataset of BaseDatasets or WindowsDatasets

braindecode.datautil.serialization.save_concat_dataset(path, concat_dataset, overwrite=False)[source]#

braindecode.datautil.util module#

braindecode.datautil.util.ms_to_samples(ms, fs)[source]#

Compute milliseconds to number of samples.

Parameters:
  • ms (number) – Milliseconds

  • fs (number) – Sampling rate

Returns:

n_samples – Number of samples

Return type:

int

braindecode.datautil.util.samples_to_ms(n_samples, fs)[source]#

Compute milliseconds to number of samples.

Parameters:
  • n_samples (number) – Number of samples

  • fs (number) – Sampling rate

Returns:

milliseconds

Return type:

int

braindecode.datautil.windowers module#

braindecode.datautil.xy module#