============================================= Stage 5: build MNE events from the triggers ============================================= Author: Hadi Zaatiti What & why ---------- Stage 5 turns the trigger information of each recording into an MNE **events** array (``N x 3``: sample, previous value, event id) saved as a ``.eve`` text file, plus an **audit TSV** with one row per detected event. Stage 6 reads these files to build epochs and evoked responses. Three variants exist; pick the one that matches how the triggers were coded during acquisition: .. list-table:: :header-rows: 1 :widths: 34 22 44 * - Script - Input - Use when * - ``5-kit_compute_events_single_channel.py`` - raw ``.con`` - **Single-channel mode**: each event type on its own analog line (KIT 224 to 231). The event id is the KIT channel number. * - ``5-kit_compute_events_multi_channel.py`` - raw ``.con`` - **Binary-coded mode**: several lines rise together to encode one code. Channels rising within ``events.multi_channel.max_onset_skew_ms`` are combined into one event. * - ``5-a-kit_compute_events_STI014.py`` - stage-2 ``.fif`` - The digital ``STI 014`` stim channel already carries the event codes (the FIF was created with the ``kit2fiff`` stim settings). Uses ``mne.find_events``. **This is the KidLang variant.** All three write into their own ``derivatives//`` folder, name the outputs with the recording's BIDS entities plus ``desc-