v2.0.0
Loading...
Searching...
No Matches
artifact_detect.h
Go to the documentation of this file.
1//=============================================================================================================
19
20#ifndef ARTIFACT_DETECT_DSP_H
21#define ARTIFACT_DETECT_DSP_H
22
23//=============================================================================================================
24// INCLUDES
25//=============================================================================================================
26
27#include "dsp_global.h"
28
29#include <fiff/fiff_info.h>
30#include <fiff/fiff_proj.h>
31
32//=============================================================================================================
33// EIGEN INCLUDES
34//=============================================================================================================
35
36#include <Eigen/Core>
37
38//=============================================================================================================
39// QT INCLUDES
40//=============================================================================================================
41
42#include <QVector>
43
44//=============================================================================================================
45// DEFINE NAMESPACE UTILSLIB
46//=============================================================================================================
47
48namespace UTILSLIB
49{
50
51//=============================================================================================================
58{
59 double dFilterLow = 5.0;
60 double dFilterHigh = 35.0;
61 double dQrsThreshold = -1.0;
62 double dTStart = 0.0;
63};
64
65//=============================================================================================================
72{
73 double dFilterLow = 1.0;
74 double dFilterHigh = 10.0;
75 double dThreshold = std::numeric_limits<double>::quiet_NaN();
76 double dTStart = 0.0;
77};
78
79//=============================================================================================================
86{
87 double dTmin = -0.2;
88 double dTmax = 0.4;
89 int nGrad = 2;
90 int nMag = 2;
91 int nEeg = 2;
92 double dFilterLow = 1.0;
93 double dFilterHigh = 35.0;
94 double dGradReject = 2000e-13;
95 double dMagReject = 3000e-15;
96 double dEegReject = 50e-6;
97 double dEogReject = 250e-6;
98
101 {
102 return {};
103 }
104
107 {
109 p.dTmax = 0.2;
110 p.dEegReject = 500e-6;
111 p.dEogReject = 0.0;
112 return p;
113 }
114};
115
116//=============================================================================================================
123{
124public:
127
128 //=========================================================================================================
142 static QVector<int> detectEcg(const Eigen::MatrixXd& matData,
143 const FIFFLIB::FiffInfo& fiffInfo,
144 double dSFreq,
145 const EcgParams& params = EcgParams());
146
147 //=========================================================================================================
161 static QVector<int> detectEog(const Eigen::MatrixXd& matData,
162 const FIFFLIB::FiffInfo& fiffInfo,
163 double dSFreq,
164 const EogParams& params = EogParams());
165
167
168 //=========================================================================================================
182 static QList<FIFFLIB::FiffProj> computeProjEcg(const Eigen::MatrixXd& matData,
183 const FIFFLIB::FiffInfo& fiffInfo,
184 double dSFreq,
185 const ProjParams& proj = ProjParams::ecg(),
186 const EcgParams& detect = EcgParams());
187
188 //=========================================================================================================
200 static QList<FIFFLIB::FiffProj> computeProjEog(const Eigen::MatrixXd& matData,
201 const FIFFLIB::FiffInfo& fiffInfo,
202 double dSFreq,
203 const ProjParams& proj = ProjParams::eog(),
204 const EogParams& detect = EogParams());
205
206private:
208 static QVector<int> qrsDetector(const Eigen::RowVectorXd& filtered, double dSFreq, double dThreshold, double dTStart);
209};
210
211} // namespace UTILSLIB
212
213#endif // ARTIFACT_DETECT_DSP_H
Full FIFF measurement metadata: everything from FIFFB_MEAS / FIFFB_MEAS_INFO needed to interpret a re...
SSP projection item: a named projection vector set with active/desired flags, parsed from FIFFB_PROJ_...
Export/import macros and namespace declaration for the DSP library.
#define DSPSHARED_EXPORT
Definition dsp_global.h:50
Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).
ECG R-peak detection parameters (defined outside class to avoid Clang/GCC default-argument issues wit...
EOG blink / saccade detection parameters (defined outside class to avoid Clang/GCC default-argument i...
SSP parameters of compute_proj_ecg / compute_proj_eog; ecg() and eog() give the MNE-Python defaults.
static ArtifactDetectProjParams eog()
static ArtifactDetectProjParams ecg()
ECG and EOG physiological artifact event detection.
ArtifactDetectProjParams ProjParams
static QVector< int > detectEcg(const Eigen::MatrixXd &matData, const FIFFLIB::FiffInfo &fiffInfo, double dSFreq, const EcgParams &params=EcgParams())
static QList< FIFFLIB::FiffProj > computeProjEcg(const Eigen::MatrixXd &matData, const FIFFLIB::FiffInfo &fiffInfo, double dSFreq, const ProjParams &proj=ProjParams::ecg(), const EcgParams &detect=EcgParams())
ArtifactDetectEogParams EogParams
ArtifactDetectEcgParams EcgParams
static QVector< int > detectEog(const Eigen::MatrixXd &matData, const FIFFLIB::FiffInfo &fiffInfo, double dSFreq, const EogParams &params=EogParams())
static QList< FIFFLIB::FiffProj > computeProjEog(const Eigen::MatrixXd &matData, const FIFFLIB::FiffInfo &fiffInfo, double dSFreq, const ProjParams &proj=ProjParams::eog(), const EogParams &detect=EogParams())
Full FIFF measurement info: per-channel descriptors, sampling and filter setup, projectors,...
Definition fiff_info.h:90