statistical.create_sl_epochs#

autoclean.functions.epoching.statistical.create_sl_epochs(data, tmin=0.0, tmax=5.4, baseline=None, reject=None, flat=None, reject_by_annotation=True, subject_id=None, syllable_codes=None, word_onset_codes=None, num_syllables_per_epoch=18, preload=True, verbose=None)[source]#

Create statistical learning epochs based on syllable event patterns.

This function creates epochs for statistical learning experiments by identifying valid word onset events followed by the expected number of syllable events. It validates that each epoch contains exactly the specified number of syllables and removes problematic DI64 events that can interfere with the analysis.

Statistical learning paradigms typically present sequences of syllables where participants learn statistical regularities. This function identifies valid epochs by ensuring each epoch contains a complete syllable sequence.

Parameters:
datamne.io.BaseRaw

The continuous EEG data containing statistical learning events.

tminfloat, default 0.0

Start time of the epoch relative to the word onset event in seconds.

tmaxfloat, default 5.4

End time of the epoch relative to the word onset event in seconds. Default corresponds to 18 syllables * 300ms duration.

baselinetuple or None, default None

Time interval for baseline correction. None applies no baseline correction. Statistical learning epochs typically don’t use baseline correction.

rejectdict or None, default None

Rejection thresholds for different channel types in volts. Example: {‘eeg’: 100e-6, ‘eog’: 200e-6}.

flatdict or None, default None

Rejection thresholds for flat channels in volts. Example: {‘eeg’: 1e-6}.

reject_by_annotationbool, default True

Whether to automatically reject epochs that overlap with ‘bad’ annotations.

subject_idstr or None, default None

Subject ID for handling special event code mappings (e.g., ‘2310’). If None, uses standard event codes.

syllable_codeslist of str or None, default None

List of event codes representing syllables. If None, uses default codes: [‘DIN1’, ‘DIN2’, …, ‘DIN9’, ‘DI10’, ‘DI11’, ‘DI12’]

word_onset_codeslist of str or None, default None

List of event codes representing word onsets. If None, uses default: [‘DIN1’, ‘DIN8’, ‘DIN9’, ‘DI11’]

num_syllables_per_epochint, default 18

Expected number of syllables per valid epoch.

preloadbool, default True

Whether to preload epoch data into memory.

verbosebool or None, default None

Control verbosity of output.

Returns:
epochsmne.Epochs

The created epochs object containing valid statistical learning sequences.

See also

create_regular_epochs

Create fixed-length epochs

create_eventid_epochs

Create event-based epochs

mne.events_from_annotations

Extract events from annotations

mne.Epochs

MNE epochs class

Examples

>>> epochs = create_sl_epochs(raw, tmin=0, tmax=5.4)
>>> epochs = create_sl_epochs(raw, subject_id='2310', num_syllables_per_epoch=16)