Static utility that labels ICA components against EOG/ECG references and a muscle spectral heuristic. More...
#include <decoding_ica_label.h>
Static Public Member Functions | |
| static QList< IcaLabelResult > | classify (const Eigen::MatrixXd &matSources, const Eigen::MatrixXd &matEog, const Eigen::MatrixXd &matEcg, double dSFreq, double dEogThresh=0.3, double dEcgThresh=0.3) |
| static QVector< int > | findArtifactComponents (const QList< IcaLabelResult > &labels) |
| static double | maxAbsCorrelation (const Eigen::VectorXd &source, const Eigen::MatrixXd &matRef) |
| static double | muscleScore (const Eigen::VectorXd &source, double dSFreq) |
Static utility that labels ICA components against EOG/ECG references and a muscle spectral heuristic.
classify walks the rows of the source matrix and applies, in order, the EOG correlation test, the ECG correlation test and the high-frequency muscle test; the first one whose score exceeds its threshold wins, otherwise the component is labelled Brain. The thresholds default to the canonical 0.3 used by the MNE-Python helpers and can be tightened or loosened per call. findArtifactComponents is the convenience that returns just the indices of the rejected components in the order expected by the ICA reconstruction code, making it a one-liner to wire automatic cleaning into a real-time pipeline.
The two scoring primitives — maxAbsCorrelation and muscleScore — are exposed publicly so an interactive viewer can display the per-component evidence behind each decision and let the user override the label without having to recompute the ICA itself. The class has no state, deleted constructor, and no virtual methods; it is purely a namespaced collection of pure functions.
Definition at line 135 of file decoding_ica_label.h.
|
static |
Classify each ICA component using reference signals and spectral heuristics.
| [in] | matSources | ICA sources (n_components x n_samples). |
| [in] | matEog | EOG reference channels (n_eog x n_samples). Can be empty. |
| [in] | matEcg | ECG reference channels (n_ecg x n_samples). Can be empty. |
| [in] | dSFreq | Sampling frequency in Hz. |
| [in] | dEogThresh | Correlation threshold for EOG classification (default 0.3). |
| [in] | dEcgThresh | Correlation threshold for ECG classification (default 0.3). |
Definition at line 74 of file decoding_ica_label.cpp.
|
static |
Extract indices of artifact components (EOG, ECG, muscle).
| [in] | labels | Label results from classify(). |
Definition at line 134 of file decoding_ica_label.cpp.
|
static |
Compute the maximum absolute Pearson correlation between a source and reference channels.
| [in] | source | Source time course (n_samples). |
| [in] | matRef | Reference channels (n_ref x n_samples). |
Definition at line 149 of file decoding_ica_label.cpp.
|
static |
Compute a simple spectral power ratio heuristic for muscle artifact detection. Muscle artifacts typically have high power above 30 Hz.
| [in] | source | Source time course (n_samples). |
| [in] | dSFreq | Sampling frequency in Hz. |
Definition at line 183 of file decoding_ica_label.cpp.