eelbrain.pipeline.Pipeline.load_epochs

Pipeline.load_epochs(baseline=True, ndvar=True, reject=True, samplingrate=None, decim=None, pad=0, tmin=None, tmax=None, tstop=None, interpolate_bads=False, src_baseline=False, morph=None, keep_mne=False, **state)[source]

Load a Dataset with epochs for a given epoch definition

Parameters:
  • subjects – Subject(s) for which to load data. Can be a single subject name or a group name such as 'all'. 1 to use the current subject; -1 for the current group. Default is current subject (or group if group is specified).

  • baseline (bool | tuple[float | None, float | None]) – Apply baseline correction using this period. True (default) to use the epoch’s baseline specification; False to not apply baseline correction.

  • ndvar (bool | str) – Data to convert to NDVar. True (default) converts all sensor types (with keys 'mag'/'grad'/'eeg' …); a sensor type ('meg'/'mag'/'grad'/'eeg'), optionally aggregated (e.g. 'eeg.rms'/'eeg.mean'), returns a single NDVar; False returns mne.Epochs with key 'epochs'. In source space (inv set) the source estimates are returned as 'src'.

  • reject (bool | Literal['keep']) – Reject bad trials. If True (default), bad trials are removed from the Dataset. Set to False to ignore the trial rejection. Set reject='keep' to load the rejection (added it to the events as 'accept' variable), but keep bad trails.

  • samplingrate (int) – Samplingrate in Hz for the analysis (default is specified in epoch definition).

  • decim (int) – Data decimation factor (alternative to samplingrate).

  • pad (scalar) – Pad the epochs with this much time (in seconds; e.g. for spectral analysis).

  • tmin (float) – Override the epoch’s tmin parameter (sensor space only).

  • tmax (float) – Override the epoch’s tmax parameter (sensor space only).

  • tstop (float) – Override the epoch’s tmax parameter as exclusive tstop (sensor space only).

  • interpolate_bads (Literal[True, False, 'keep']) – Interpolate channels marked as bad for the whole recording (useful when comparing topographies across subjects; default False; sensor space only). True interpolates and includes those channels in the output; 'keep' interpolates but leaves the channels marked as bad (so they remain excluded from NDVar output).

  • src_baseline (bool | tuple[float | None, float | None]) – Apply baseline correction in source space using this period (source space only; True to use the epoch’s baseline specification).

  • morph (bool) – Morph source estimates to the common brain (source space only; default False, except when loading multiple subjects with ndvar=True).

  • keep_mne (bool) – Also include the underlying mne.Epochs (sensor space) or sensor-space data (source space) in the returned Dataset.

  • ...

    Applicable State Parameters:

    • raw: preprocessing pipeline

    • epoch: which events to use and time window

    • epoch_rejection: which trials to use

    • inv: inverse solution (inv='' for sensor space, a non-empty inverse for source space)

Return type:

Dataset