bemobil_mne.preproc.EpochPreparer#
- class bemobil_mne.preproc.EpochPreparer(remaps, *, epoch_tlimes=(-0.2, 0.8), baseline=(-0.2, 0), bandpass_erp=(None, 20.0), tshift=0.06)[source]#
Bases:
objectPrepare condition-specific epochs from a cleaned raw recording.
Handles event remapping (from raw
trialStartannotations to condition/stimulus labels and then to user-supplied category labels), optional latency correction, bandpass filtering, and epoching.- Parameters:
- remaps
dict[str,dict[str,str]] Mapping of condition name → {original_label: target_label}. Only annotations whose remapped value appears in the condition’s remap dict values are retained for epoching.
- epoch_tlimes
tupleoffloat (tmin, tmax)in seconds for epochs relative to the event onset.- baseline
tupleoffloat|None Baseline window
(tmin, tmax)passed tomne.Epochs.- bandpass_erp
tupleof(float|None,float|None) (l_freq, h_freq)bandpass applied before epoching.- tshift
float Stimulus onset delay in seconds. Annotation onsets are shifted forward by this amount so that
t=0aligns with actual stimulus presentation. Set to0to disable.
- remaps
- Parameters:
- __init__(remaps, *, epoch_tlimes=(-0.2, 0.8), baseline=(-0.2, 0), bandpass_erp=(None, 20.0), tshift=0.06)[source]#
Methods
__init__(remaps, *[, epoch_tlimes, ...])run(raw_clean, fname_out, cond, *[, overwrite])Run event remapping, filtering, and epoching for one condition.
- run(raw_clean, fname_out, cond, *, overwrite=False)[source]#
Run event remapping, filtering, and epoching for one condition.
- Parameters:
- raw_clean
mne.io.BaseRaw ICA-cleaned raw recording that still carries all annotations.
- fname_out
str|Path Output stem;
_epo.fif.gzis appended automatically.- cond
str Condition key that must exist in
self.remaps.- overwritebool
Overwrite existing epoch file.
- raw_clean
- Returns:
- epochs_dict
dict[str,mne.Epochs] {label: epochs}for each target label in the condition remap.
- epochs_dict
- Parameters:
- Return type: