ArtifactDetect
Namespace: UTILSLIB · Library: Utilities Library
#include <utils/artifact_detect.h>
class UTILSLIB::ArtifactDetect
ECG and EOG physiological artifact event detection.
ArtifactDetect::EcgParams ecg; // mne find_ecg_events defaults: 5-35 Hz, automatic QRS threshold
ArtifactDetect::EogParams eog; // mne find_eog_events defaults: 1-10 Hz, automatic peak threshold
const QVector<int> beats = ArtifactDetect::detectEcg(data, info, kSFreq, ecg); // R-peak samples on the ECG channel
const QVector<int> blinks = ArtifactDetect::detectEog(data, info, kSFreq, eog); // blink peaks on the EOG channel
Static Methods
detectEcg(matData, fiffInfo, dSFreq, params)
Detect ECG R-peak events as mne.preprocessing.find_ecg_events does.
Uses the first good channel with kind == FIFFV_ECG_CH; without one, the mean of the good magnetometers (or, failing those, gradiometers) stands in for it.
Parameters:
-
matData : const Eigen::MatrixXd & Raw data matrix (n_channels × n_samples), calibrated (SI units).
-
fiffInfo : const FiffInfo & Measurement info (channel kinds, names).
-
dSFreq : double Sampling frequency in Hz.
-
params : const EcgParams & Detection parameters.
Returns:
- QVector< int > — Sample indices (0-based) of detected R-peaks.
detectEog(matData, fiffInfo, dSFreq, params)
Detect EOG blink/saccade events as mne.preprocessing.find_eog_events does.
Of the good channels with kind == FIFFV_EOG_CH, the one with the most 2-45 Hz energy is used. Returns an empty vector if no EOG channel is found.
Parameters:
-
matData : const Eigen::MatrixXd & Raw data matrix (n_channels × n_samples), calibrated (SI units).
-
fiffInfo : const FiffInfo & Measurement info.
-
dSFreq : double Sampling frequency in Hz.
-
params : const EogParams & Detection parameters.
Returns:
- QVector< int > — Sample indices (0-based) of the detected EOG peaks.
computeProjEcg(matData, fiffInfo, dSFreq, proj, detect)
SSP projectors for heartbeat artifacts as mne.preprocessing.compute_proj_ecg does: ECG events, band-passed data with the info projectors applied, peak-to-peak rejection, average, then FiffProj::compute_from_evoked.
Returns the info projectors followed by the new ones ("ECG-...").
Parameters:
-
matData : const Eigen::MatrixXd & Raw data (n_channels × n_samples), calibrated (SI units).
-
fiffInfo : const FiffInfo & Measurement info including its projectors.
-
dSFreq : double Sampling frequency in Hz.
-
proj : const ProjParams & Epoching, filtering, rejection and vector counts.
-
detect : const EcgParams & ECG event detection parameters.
Returns:
- QList< FiffProj > — The projectors, or only the info projectors if no event or epoch survives.
computeProjEog(matData, fiffInfo, dSFreq, proj, detect)
SSP projectors for blink artifacts as mne.preprocessing.compute_proj_eog does (see computeProjEcg).
Parameters:
-
matData : const Eigen::MatrixXd & Raw data (n_channels × n_samples), calibrated (SI units).
-
fiffInfo : const FiffInfo & Measurement info including its projectors.
-
dSFreq : double Sampling frequency in Hz.
-
proj : const ProjParams & Epoching, filtering, rejection and vector counts.
-
detect : const EogParams & EOG event detection parameters.
Returns:
- QList< FiffProj > — The projectors, or only the info projectors if no event or epoch survives.
Example
- Full source:
src/examples/ex_dsp_artifacts/main.cpp - Build target:
ex_dsp_artifacts(runs under CTest)
Authors of this file
- Christoph Dinh <christoph.dinh@mne-cpp.org>