v2.0.0
Loading...
Searching...
No Matches
bad_channel_detect.h
Go to the documentation of this file.
1//=============================================================================================================
28
29#ifndef BAD_CHANNEL_DETECT_DSP_H
30#define BAD_CHANNEL_DETECT_DSP_H
31
32//=============================================================================================================
33// INCLUDES
34//=============================================================================================================
35
36#include "dsp_global.h"
37
38//=============================================================================================================
39// EIGEN INCLUDES
40//=============================================================================================================
41
42#include <Eigen/Core>
43
44//=============================================================================================================
45// QT INCLUDES
46//=============================================================================================================
47
48#include <QVector>
49
50//=============================================================================================================
51// DEFINE NAMESPACE UTILSLIB
52//=============================================================================================================
53
54namespace UTILSLIB
55{
56
57//=============================================================================================================
64{
65 // Flat signal
66 double dFlatThreshold = 1e-13;
67
68 // High variance
69 double dVarZThresh = 4.0;
70
71 // Low correlation
72 double dCorrThresh = 0.4;
73 int iNeighbours = 5;
74};
75
76//=============================================================================================================
83{
84public:
86
87 //=========================================================================================================
98 static QVector<int> detect(const Eigen::MatrixXd& matData,
99 const Params& params = Params());
100
101 //=========================================================================================================
112 static QVector<int> detectFlat(const Eigen::MatrixXd& matData,
113 double dThreshold = 1e-13);
114
115 //=========================================================================================================
128 static QVector<int> detectHighVariance(const Eigen::MatrixXd& matData,
129 double dZThresh = 4.0);
130
131 //=========================================================================================================
149 static QVector<int> detectLowCorrelation(const Eigen::MatrixXd& matData,
150 double dCorrThresh = 0.4,
151 int iNeighbours = 5);
152
153private:
154 //=========================================================================================================
159 static double pearsonCorr(const Eigen::RowVectorXd& a, const Eigen::RowVectorXd& b);
160
161 //=========================================================================================================
165 static double median(QVector<double> values);
166};
167
168} // namespace UTILSLIB
169
170#endif // BAD_CHANNEL_DETECT_DSP_H
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).
Bad-channel detection parameters (defined outside class to avoid Clang/GCC default-argument issues wi...
Automated detection of bad MEG/EEG channels using flat, variance, and correlation criteria.
BadChannelDetectParams Params
static QVector< int > detect(const Eigen::MatrixXd &matData, const Params &params=Params())
static QVector< int > detectHighVariance(const Eigen::MatrixXd &matData, double dZThresh=4.0)
static QVector< int > detectLowCorrelation(const Eigen::MatrixXd &matData, double dCorrThresh=0.4, int iNeighbours=5)
static QVector< int > detectFlat(const Eigen::MatrixXd &matData, double dThreshold=1e-13)