eelbrain.load.mne.variable_length_epochs

eelbrain.load.mne.variable_length_epochs(ds, tmin, tmax=None, baseline=None, allow_truncation=False, data=None, exclude='bads', sysname=None, connectivity=None, tstop=None, name=None, **kwargs)

Load data epochs where each epoch has a different length

Parameters:
  • ds (Dataset) – Dataset containing a variable which defines epoch cues (i_start).

  • tmin (float | Sequence[float]) – First sample to include in the epochs in seconds (Default is -0.1).

  • tmax (float | Sequence[float]) – Last sample to include in each epoch in seconds. Use tstop instead to specify index exclusive of last sample

  • baseline (Tuple[float | None, float | None] | None) – Time interval for baseline correction. (tmin, tmax) tuple in seconds, or None to use all the data (e.g., (None, 0) uses all the data from the beginning of the epoch up to t = 0). Set to None for no baseline correction (default).

  • allow_truncation (bool) – If a tmax value falls outside the data available in raw, automatically truncate the epoch (by default this raises a ValueError).

  • data (Literal['eeg', 'mag', 'grad']) – Which data channels data to include (default based on channels in data).

  • exclude (str | Sequence[str]) – Channels to exclude (mne.pick_types() kwarg). If ‘bads’ (default), exclude channels in info[‘bads’]. If empty do not exclude any.

  • sysname (str) – Name of the sensor system to load sensor connectivity (e.g. ‘neuromag306’, inferred automatically for KIT data converted with a recent version of MNE-Python).

  • connectivity (str | list of (str, str) | array of int, (n_edges, 2)) –

    Connectivity between elements. Can be specified as:

    • "none" for no connections

    • list of connections (e.g., [('OZ', 'O1'), ('OZ', 'O2'), ...])

    • numpy.ndarray of int, shape (n_edges, 2), to specify connections in terms of indices. Each row should specify one connection [i, j] with i < j. If the array’s dtype is uint32, property checks are disabled to improve efficiency.

    • "grid" to use adjacency in the sensor names

    If unspecified, it is inferred from sysname if possible.

  • tstop (float | Sequence[float]) – Alternative to tmax. While tmax specifies the last samples to include, tstop specifies the sample before which to stop (standard Python indexing convention). For example, at 100 Hz the epoch with tmin=-0.1, tmax=0.4 will have 51 samples, while the epoch specified with tmin=-0.1, tstop=0.4 will have 50 samples.

  • name (str) – Name for the NDVar.

  • ...mne.Epochs parameters.

Returns:

List of data epochs of shape.

Return type:

epochs