Remove EOG artifacts via linear regression. More...
#include <eog_regression.h>
Public Member Functions | |
| EogRegression ()=default | |
| void | fit (const Eigen::MatrixXd &data, const FIFFLIB::FiffInfo &info, const QStringList &eogChannels=QStringList()) |
| Fit regression coefficients from EOG to all other channels. | |
| void | apply (Eigen::MatrixXd &data, const FIFFLIB::FiffInfo &info) const |
| Apply the fitted regression to remove EOG artifacts in-place. | |
| const Eigen::MatrixXd & | coefficients () const |
| Returns the fitted regression coefficients. | |
| bool | isFitted () const |
| Returns true if fit() has been called successfully. | |
Static Public Member Functions | |
| static void | fitApply (Eigen::MatrixXd &data, const FIFFLIB::FiffInfo &info, const QStringList &eogChannels=QStringList()) |
| Convenience: fit and apply in one step. | |
Remove EOG artifacts via linear regression.
Fits a least-squares model: data_ch = beta * EOG + residual, then subtracts beta * EOG from each non-EOG channel.
Usage:
Definition at line 66 of file eog_regression.h.
|
default |
Constructs a default EogRegression object.
| void EogRegression::apply | ( | Eigen::MatrixXd & | data, |
| const FIFFLIB::FiffInfo & | info ) const |
Apply the fitted regression to remove EOG artifacts in-place.
Subtracts beta * EOG from all non-EOG channels. fit() must be called first.
| [in,out] | data | Data matrix (n_channels x n_times). Modified in-place. |
| [in] | info | Measurement info. |
Definition at line 127 of file eog_regression.cpp.
|
inline |
Returns the fitted regression coefficients.
Definition at line 119 of file eog_regression.h.
| void EogRegression::fit | ( | const Eigen::MatrixXd & | data, |
| const FIFFLIB::FiffInfo & | info, | ||
| const QStringList & | eogChannels = QStringList() ) |
Fit regression coefficients from EOG to all other channels.
Uses ordinary least squares: beta = T * E^T * (E * E^T)^{-1}
| [in] | data | Data matrix (n_channels x n_times). |
| [in] | info | Measurement info (identifies EOG channels by kind == FIFFV_EOG_CH). |
| [in] | eogChannels | Optional explicit EOG channel names. If empty, auto-detect from info. |
Definition at line 47 of file eog_regression.cpp.
|
static |
Convenience: fit and apply in one step.
| [in,out] | data | Data matrix (n_channels x n_times). Modified in-place. |
| [in] | info | Measurement info. |
| [in] | eogChannels | Optional explicit EOG channel names. |
Definition at line 159 of file eog_regression.cpp.
|
inline |
Returns true if fit() has been called successfully.
Definition at line 125 of file eog_regression.h.