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 { class FiffInfo; }
43
44//=============================================================================================================
45// DEFINE NAMESPACE UTILSLIB
46//=============================================================================================================
47
48namespace UTILSLIB {
49
50//=============================================================================================================
67{
68public:
69 //=========================================================================================================
73 EogRegression() = default;
74
75 //=========================================================================================================
85 void fit(const Eigen::MatrixXd& data,
86 const FIFFLIB::FiffInfo& info,
87 const QStringList& eogChannels = QStringList());
88
89 //=========================================================================================================
99 void apply(Eigen::MatrixXd& data,
100 const FIFFLIB::FiffInfo& info) const;
101
102 //=========================================================================================================
110 static void fitApply(Eigen::MatrixXd& data,
111 const FIFFLIB::FiffInfo& info,
112 const QStringList& eogChannels = QStringList());
113
114 //=========================================================================================================
119 const Eigen::MatrixXd& coefficients() const { return m_matBeta; }
120
121 //=========================================================================================================
125 bool isFitted() const { return m_bFitted; }
126
127private:
128 Eigen::MatrixXd m_matBeta;
129 QVector<int> m_vecEogIndices;
130 QVector<int> m_vecTargetIndices;
131 bool m_bFitted = false;
132};
133
134} // namespace UTILSLIB
135
136#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:88