v2.0.0
Loading...
Searching...
No Matches
rt_detect_trigger.h File Reference

Threshold and edge-based trigger detection on streaming stim channels. More...

#include "../dsp_global.h"
#include <QPair>
#include <Eigen/Core>
Include dependency graph for rt_detect_trigger.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  RTPROCESSINGLIB

Functions

DSPSHARED_EXPORT QList< Eigen::MatrixXi > RTPROCESSINGLIB::toEventMatrix (QMap< int, QList< QPair< int, double > > > mapTriggers)
DSPSHARED_EXPORT QMap< int, QList< QPair< int, double > > > RTPROCESSINGLIB::detectTriggerFlanksMax (const Eigen::MatrixXd &data, const QList< int > &lTriggerChannels, int iOffsetIndex, double dThreshold, bool bRemoveOffset, int iBurstLengthSamp=100)
DSPSHARED_EXPORT QList< QPair< int, double > > RTPROCESSINGLIB::detectTriggerFlanksMax (const Eigen::MatrixXd &data, int iTriggerChannelIdx, int iOffsetIndex, double dThreshold, bool bRemoveOffset, int iBurstLengthSamp=100)
DSPSHARED_EXPORT QMap< int, QList< QPair< int, double > > > RTPROCESSINGLIB::detectTriggerFlanksGrad (const Eigen::MatrixXd &data, const QList< int > &lTriggerChannels, int iOffsetIndex, double dThreshold, bool bRemoveOffset, const QString &type, int iBurstLengthSamp=100)
DSPSHARED_EXPORT QList< QPair< int, double > > RTPROCESSINGLIB::detectTriggerFlanksGrad (const Eigen::MatrixXd &data, int iTriggerChannelIdx, int iOffsetIndex, double dThreshold, bool bRemoveOffset, const QString &type, int iBurstLengthSamp=100)

Detailed Description

Threshold and edge-based trigger detection on streaming stim channels.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.1.0
Date
March 2026

The functions in this header scan the rows of an incoming data matrix — typically the stimulus / digital-trigger channels of a MEG or EEG file — for sign or value transitions and return the sample index and amplitude of every detected flank. detectTriggerFlanks uses Eigen's maxCoeff over the per-sample derivative to localise rising edges, with optional de-bouncing controlled by a minimum inter-event distance.

toEventMatrix turns the per-channel QMap of detected events into the canonical three-column Eigen::MatrixXi event layout (sample, previous code, new code) consumed by the rest of the mne-cpp pipeline (averaging, epoching, annotations).

Definition in file rt_detect_trigger.h.