Crop#

class dpeeg.transforms.Crop(tmin: int = 0, tmax: int | None = None, include_tmax: bool = False)[source]#

Crop a time interval.

Crop the eeg signal in terms of time. Default is edata.

Parameters:
  • tmin (int) – Start time of selection in sampling points.

  • tmax (int) – End time of selection in sampling points. None means use the full time.

  • include_tmax (bool) – If False, exclude tmax.

Returns:

data – Transformed eegdata.

Return type:

eegdata or dataset

Examples

>>> eegdata = dpeeg.EEGData(edata=np.random.randn(16, 3, 10),
...                         label=np.random.randint(0, 3, 16))
>>> transforms.Crop(4, 9)(eegdata, verbose=False)
[edata=(16, 3, 5), label=(16,)]