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.
As mne.preprocessing.EOGRegression: fits data_ch = beta * EOG + residual on time-demeaned signals for every good data channel and subtracts beta times the demeaned EOG.
Definition at line 63 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 times the demeaned EOG from the channels fit() regressed. 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 104 of file eog_regression.cpp.
|
inline |
Returns the fitted regression coefficients.
Definition at line 117 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.
Ordinary least squares on demeaned signals: beta = T * E^T * (E * E^T)^{-1}, T being the good data channels (FiffInfoBase::pick_data_channels without the bads).
| [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, the good channels of kind FIFFV_EOG_CH. |
Definition at line 64 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 120 of file eog_regression.cpp.
|
inline |
Returns true if fit() has been called successfully.
Definition at line 128 of file eog_regression.h.