bemobil_mne.preproc.get_stimulus_rename_map#

bemobil_mne.preproc.get_stimulus_rename_map(descriptions)[source]#

Build an event rename map from trialStart annotation descriptions.

Parses condition:<name> and stimulus:<name> fields out of each trialStart annotation and produces a mapping from the raw description string to a "condition/stimulus" label, plus a label-to-integer ID lookup.

Parameters:
descriptionslist of str

Annotation description strings from raw.annotations.description.

Returns:
rename_mapdict[str, str]

Maps each raw trialStart description to its "condition/stimulus" label.

label_to_iddict[str, int]

Maps each unique "condition/stimulus" label to an integer event ID (1-indexed, sorted alphabetically).

Parameters:

descriptions (list[str])

Return type:

tuple[dict[str, str], dict[str, int]]