v2.0.0
Loading...
Searching...
No Matches
UTILSLIB::ArtifactDetect Class Reference

ECG and EOG physiological artifact event detection. More...

#include <artifact_detect.h>

Public Types

using EcgParams = ArtifactDetectEcgParams
using EogParams = ArtifactDetectEogParams

Static Public Member Functions

static QVector< int > detectEcg (const Eigen::MatrixXd &matData, const FIFFLIB::FiffInfo &fiffInfo, double dSFreq, const EcgParams &params=EcgParams())
static QVector< int > detectEog (const Eigen::MatrixXd &matData, const FIFFLIB::FiffInfo &fiffInfo, double dSFreq, const EogParams &params=EogParams())

Detailed Description

ECG and EOG physiological artifact event detection.

// ECG: returns sample indices of R-peaks
QVector<int> rPeaks = ArtifactDetect::detectEcg(matData, fiffInfo, sFreq);
// EOG: returns sample indices of blink/saccade onsets
QVector<int> blinks = ArtifactDetect::detectEog(matData, fiffInfo, sFreq);
static QVector< int > detectEcg(const Eigen::MatrixXd &matData, const FIFFLIB::FiffInfo &fiffInfo, double dSFreq, const EcgParams &params=EcgParams())
static QVector< int > detectEog(const Eigen::MatrixXd &matData, const FIFFLIB::FiffInfo &fiffInfo, double dSFreq, const EogParams &params=EogParams())

Definition at line 104 of file artifact_detect.h.

Member Typedef Documentation

◆ EcgParams

Convenience alias so callers can still write ArtifactDetect::EcgParams.

Definition at line 107 of file artifact_detect.h.

◆ EogParams

Convenience alias so callers can still write ArtifactDetect::EogParams.

Definition at line 108 of file artifact_detect.h.

Member Function Documentation

◆ detectEcg()

QVector< int > ArtifactDetect::detectEcg ( const Eigen::MatrixXd & matData,
const FIFFLIB::FiffInfo & fiffInfo,
double dSFreq,
const EcgParams & params = EcgParams() )
static

Detect ECG R-peak events.

The function searches FiffInfo for a channel with kind == FIFFV_ECG_CH. If none is found it synthesises an ECG proxy by averaging the absolute gradient-magnetometer data (MEG channels), which often shows a clear cardiac artefact.

Parameters
[in]matDataRaw data matrix (n_channels × n_samples), calibrated (SI units).
[in]fiffInfoMeasurement info (channel kinds, names).
[in]dSFreqSampling frequency in Hz.
[in]paramsDetection parameters.
Returns
Sample indices (0-based) of detected R-peaks.

Definition at line 134 of file artifact_detect.cpp.

◆ detectEog()

QVector< int > ArtifactDetect::detectEog ( const Eigen::MatrixXd & matData,
const FIFFLIB::FiffInfo & fiffInfo,
double dSFreq,
const EogParams & params = EogParams() )
static

Detect EOG blink/saccade events.

The function searches FiffInfo for channels with kind == FIFFV_EOG_CH. If multiple EOG channels are present the channel with the largest peak-to-peak amplitude is used. Returns an empty vector if no EOG channel is found.

Parameters
[in]matDataRaw data matrix (n_channels × n_samples), calibrated (SI units).
[in]fiffInfoMeasurement info.
[in]dSFreqSampling frequency in Hz.
[in]paramsDetection parameters.
Returns
Sample indices (0-based) of detected EOG events (onset of supra-threshold excursion).

Definition at line 215 of file artifact_detect.cpp.


The documentation for this class was generated from the following files: