braindecode.preprocessing.create_fixed_length_windows#

braindecode.preprocessing.create_fixed_length_windows(concat_ds: BaseConcatDataset, start_offset_samples: int = 0, stop_offset_samples: int | None = None, window_size_samples: int | None = None, window_stride_samples: int | None = None, drop_last_window: bool | None = None, mapping: dict[str, int] | None = None, preload: bool = False, picks: str | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | slice | None = None, reject: dict[str, float] | None = None, flat: dict[str, float] | None = None, targets_from: str = 'metadata', last_target_only: bool = True, lazy_metadata: bool = False, on_missing: str = 'error', n_jobs: int = 1, verbose: bool | str | int | None = 'error')[source]#

Windower that creates sliding windows.

Parameters:
  • concat_ds (ConcatDataset) – A concat of base datasets each holding raw and description.

  • start_offset_samples (int) – Start offset from beginning of recording in samples.

  • stop_offset_samples (int | None) – Stop offset from beginning of recording in samples. If None, set to be the end of the recording.

  • window_size_samples (int | None) – Window size in samples. If None, set to be the maximum possible window size, ie length of the recording, once offsets are accounted for.

  • window_stride_samples (int | None) – Stride between windows in samples. If None, set to be equal to winddow_size_samples, so windows will not overlap.

  • drop_last_window (bool | None) – Whether or not have a last overlapping window, when windows do not equally divide the continuous signal. Must be set to a bool if window size and stride are not None.

  • mapping (dict(str: int)) – Mapping from event description to target value.

  • preload (bool) – If True, preload the data of the Epochs objects.

  • picks (str | list | slice | None) – Channels to include. If None, all available channels are used. See mne.Epochs.

  • reject (dict | None) – Epoch rejection parameters based on peak-to-peak amplitude. If None, no rejection is done based on peak-to-peak amplitude. See mne.Epochs.

  • flat (dict | None) – Epoch rejection parameters based on flatness of signals. If None, no rejection based on flatness is done. See mne.Epochs.

  • lazy_metadata (bool) – If True, metadata is not computed immediately, but only when accessed by using the _LazyDataFrame (experimental).

  • on_missing (str) – What to do if one or several event ids are not found in the recording. Valid keys are ‘error’ | ‘warning’ | ‘ignore’. See mne.Epochs.

  • n_jobs (int) – Number of jobs to use to parallelize the windowing.

  • verbose (bool | str | int | None) – Control verbosity of the logging output when calling mne.Epochs.

Returns:

windows_datasets – Concatenated datasets of WindowsDataset containing the extracted windows.

Return type:

BaseConcatDataset

Examples using braindecode.preprocessing.create_fixed_length_windows#

Convolutional neural network regression model on fake data.

Convolutional neural network regression model on fake data.

Benchmarking eager and lazy loading

Benchmarking eager and lazy loading

Benchmarking preprocessing with parallelization and serialization

Benchmarking preprocessing with parallelization and serialization

Multiple discrete targets with the TUH EEG Corpus

Multiple discrete targets with the TUH EEG Corpus

Fingers flexion cropped decoding on BCIC IV 4 ECoG Dataset

Fingers flexion cropped decoding on BCIC IV 4 ECoG Dataset

Process a big data EEG resource (TUH EEG Corpus)

Process a big data EEG resource (TUH EEG Corpus)