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 //=========================================================================================================
83 void fit(const Eigen::MatrixXd& data,
84 const FIFFLIB::FiffInfo& info,
85 const QStringList& eogChannels = QStringList());
86
87 //=========================================================================================================
97 void apply(Eigen::MatrixXd& data,
98 const FIFFLIB::FiffInfo& info) const;
99
100 //=========================================================================================================
108 static void fitApply(Eigen::MatrixXd& data,
109 const FIFFLIB::FiffInfo& info,
110 const QStringList& eogChannels = QStringList());
111
112 //=========================================================================================================
117 const Eigen::MatrixXd& coefficients() const
118 {
119 return m_matBeta;
120 }
121
122 //=========================================================================================================
128 bool isFitted() const
129 {
130 return m_bFitted;
131 }
132
133private:
134 Eigen::MatrixXd m_matBeta;
135 QVector<int> m_vecEogIndices;
136 QVector<int> m_vecTargetIndices;
137 bool m_bFitted = false;
138};
139
140} // namespace UTILSLIB
141
142#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