v2.0.0
Loading...
Searching...
No Matches
eog_regression.h
Go to the documentation of this file.
1//=============================================================================================================
15
16#ifndef EOG_REGRESSION_DSP_H
17#define EOG_REGRESSION_DSP_H
18
19//=============================================================================================================
20// INCLUDES
21//=============================================================================================================
22
23#include "dsp_global.h"
24
25//=============================================================================================================
26// EIGEN INCLUDES
27//=============================================================================================================
28
29#include <Eigen/Core>
30
31//=============================================================================================================
32// QT INCLUDES
33//=============================================================================================================
34
35#include <QStringList>
36#include <QVector>
37
38//=============================================================================================================
39// FORWARD DECLARATIONS
40//=============================================================================================================
41
42namespace FIFFLIB
43{
44class FiffInfo;
45}
46
47//=============================================================================================================
48// DEFINE NAMESPACE UTILSLIB
49//=============================================================================================================
50
51namespace UTILSLIB
52{
53
54//=============================================================================================================
64{
65public:
66 //=========================================================================================================
70 EogRegression() = default;
71
72 //=========================================================================================================
82 void fit(const Eigen::MatrixXd& data,
83 const FIFFLIB::FiffInfo& info,
84 const QStringList& eogChannels = QStringList());
85
86 //=========================================================================================================
96 void apply(Eigen::MatrixXd& data,
97 const FIFFLIB::FiffInfo& info) const;
98
99 //=========================================================================================================
107 static void fitApply(Eigen::MatrixXd& data,
108 const FIFFLIB::FiffInfo& info,
109 const QStringList& eogChannels = QStringList());
110
111 //=========================================================================================================
116 const Eigen::MatrixXd& coefficients() const
117 {
118 return m_matBeta;
119 }
120
121 //=========================================================================================================
127 bool isFitted() const
128 {
129 return m_bFitted;
130 }
131
132private:
133 Eigen::MatrixXd m_matBeta;
134 QVector<int> m_vecEogIndices;
135 QVector<int> m_vecTargetIndices;
136 bool m_bFitted = false;
137};
138
139} // namespace UTILSLIB
140
141#endif // EOG_REGRESSION_DSP_H
Export/import macros and namespace declaration for the DSP library.
#define DSPSHARED_EXPORT
Definition dsp_global.h:50
FIFF file I/O, in-memory data structures and high-level readers/writers.
Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).
bool isFitted() const
Returns true if fit() has been called successfully.
void apply(Eigen::MatrixXd &data, const FIFFLIB::FiffInfo &info) const
Apply the fitted regression to remove EOG artifacts in-place.
static void fitApply(Eigen::MatrixXd &data, const FIFFLIB::FiffInfo &info, const QStringList &eogChannels=QStringList())
Convenience: fit and apply in one step.
void fit(const Eigen::MatrixXd &data, const FIFFLIB::FiffInfo &info, const QStringList &eogChannels=QStringList())
Fit regression coefficients from EOG to all other channels.
const Eigen::MatrixXd & coefficients() const
Returns the fitted regression coefficients.
Full FIFF measurement info: per-channel descriptors, sampling and filter setup, projectors,...
Definition fiff_info.h:90