v2.0.0
Loading...
Searching...
No Matches
UTILSLIB::EogRegression Class Reference

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ EogRegression()

UTILSLIB::EogRegression::EogRegression ( )
default

Constructs a default EogRegression object.

Member Function Documentation

◆ apply()

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.

Parameters
[in,out]dataData matrix (n_channels x n_times). Modified in-place.
[in]infoMeasurement info.

Definition at line 104 of file eog_regression.cpp.

◆ coefficients()

const Eigen::MatrixXd & UTILSLIB::EogRegression::coefficients ( ) const
inline

Returns the fitted regression coefficients.

Returns
Matrix (n_non_eog_channels x n_eog_channels).

Definition at line 117 of file eog_regression.h.

◆ fit()

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).

Parameters
[in]dataData matrix (n_channels x n_times).
[in]infoMeasurement info (identifies EOG channels by kind == FIFFV_EOG_CH).
[in]eogChannelsOptional explicit EOG channel names. If empty, the good channels of kind FIFFV_EOG_CH.

Definition at line 64 of file eog_regression.cpp.

◆ fitApply()

void EogRegression::fitApply ( Eigen::MatrixXd & data,
const FIFFLIB::FiffInfo & info,
const QStringList & eogChannels = QStringList() )
static

Convenience: fit and apply in one step.

Parameters
[in,out]dataData matrix (n_channels x n_times). Modified in-place.
[in]infoMeasurement info.
[in]eogChannelsOptional explicit EOG channel names.

Definition at line 120 of file eog_regression.cpp.

◆ isFitted()

bool UTILSLIB::EogRegression::isFitted ( ) const
inline

Returns true if fit() has been called successfully.

Returns
True if regression coefficients are available, false otherwise.

Definition at line 128 of file eog_regression.h.


The documentation for this class was generated from the following files: