v2.0.0
Loading...
Searching...
No Matches
bad_channel_detect.h
Go to the documentation of this file.
1//=============================================================================================================
49
50#ifndef BAD_CHANNEL_DETECT_DSP_H
51#define BAD_CHANNEL_DETECT_DSP_H
52
53//=============================================================================================================
54// INCLUDES
55//=============================================================================================================
56
57#include "dsp_global.h"
58
59//=============================================================================================================
60// EIGEN INCLUDES
61//=============================================================================================================
62
63#include <Eigen/Core>
64
65//=============================================================================================================
66// QT INCLUDES
67//=============================================================================================================
68
69#include <QVector>
70
71//=============================================================================================================
72// DEFINE NAMESPACE UTILSLIB
73//=============================================================================================================
74
75namespace UTILSLIB
76{
77
78//=============================================================================================================
81{
82 // Flat signal
83 double dFlatThreshold = 1e-13;
84
85 // High variance
86 double dVarZThresh = 4.0;
87
88 // Low correlation
89 double dCorrThresh = 0.4;
90 int iNeighbours = 5;
91};
92
93//=============================================================================================================
109{
110public:
112
113 //=========================================================================================================
124 static QVector<int> detect(const Eigen::MatrixXd& matData,
125 const Params& params = Params());
126
127 //=========================================================================================================
138 static QVector<int> detectFlat(const Eigen::MatrixXd& matData,
139 double dThreshold = 1e-13);
140
141 //=========================================================================================================
154 static QVector<int> detectHighVariance(const Eigen::MatrixXd& matData,
155 double dZThresh = 4.0);
156
157 //=========================================================================================================
175 static QVector<int> detectLowCorrelation(const Eigen::MatrixXd& matData,
176 double dCorrThresh = 0.4,
177 int iNeighbours = 5);
178
179private:
180 //=========================================================================================================
185 static double pearsonCorr(const Eigen::RowVectorXd& a, const Eigen::RowVectorXd& b);
186
187 //=========================================================================================================
191 static double median(QVector<double> values);
192};
193
194} // namespace UTILSLIB
195
196#endif // BAD_CHANNEL_DETECT_DSP_H
dsp library export/import macros.
#define DSPSHARED_EXPORT
Definition dsp_global.h:56
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)