Channel derivation and re-referencing utilities. More...
#include <channel_derivation.h>
Static Public Member Functions | |
| static QVector< DerivationRule > | buildBipolar (const QStringList &channelNames) |
| Build bipolar derivation rules from sequential electrode pairs. | |
| static QVector< DerivationRule > | buildCommonAverage (const QStringList &channelNames) |
| Build common-average reference derivation rules. | |
| static QPair< Eigen::MatrixXd, QStringList > | apply (const Eigen::MatrixXd &matData, const QStringList &channelNames, const QVector< DerivationRule > &rules) |
| Apply derivation rules to a data matrix. | |
| static QVector< DerivationRule > | readDefinitionFile (const QString &path) |
| Read derivation rules from a text definition file. | |
| static bool | writeDefinitionFile (const QString &path, const QVector< DerivationRule > &rules) |
| Write derivation rules to a text definition file. | |
Channel derivation and re-referencing utilities.
Provides methods to build bipolar and common-average re-referencing schemes, apply arbitrary linear derivation rules to data matrices, and read/write derivation definition files.
Definition at line 93 of file channel_derivation.h.
|
static |
Apply derivation rules to a data matrix.
| [in] | matData | Input data matrix (n_channels × n_times). |
| [in] | channelNames | Channel names corresponding to rows of matData. |
| [in] | rules | Derivation rules to apply. |
Definition at line 144 of file channel_derivation.cpp.
|
static |
Build bipolar derivation rules from sequential electrode pairs.
Channels are grouped by shaft prefix (all leading alphabetic characters and apostrophes before the first digit). Within each group, consecutive pairs are subtracted: channel[i] − channel[i+1].
| [in] | channelNames | List of channel names, e.g. {"LH1","LH2","LH3","RA1","RA2"}. |
Definition at line 84 of file channel_derivation.cpp.
|
static |
Build common-average reference derivation rules.
Each output channel equals the original channel minus the mean of all channels: out_i = ch_i − (1/N) Σ ch_j.
| [in] | channelNames | List of channel names. |
Definition at line 116 of file channel_derivation.cpp.
|
static |
Read derivation rules from a text definition file.
File format (lines starting with '#' are comments):
| [in] | path | Path to the definition file. |
Definition at line 180 of file channel_derivation.cpp.
|
static |
Write derivation rules to a text definition file.
| [in] | path | Path to the output file. |
| [in] | rules | Derivation rules to write. |
Definition at line 235 of file channel_derivation.cpp.