Automated detection of bad MEG/EEG channels using flat, variance, and correlation criteria. More...
#include <bad_channel_detect.h>
Public Types | |
| using | Params = BadChannelDetectParams |
Static Public Member Functions | |
| static QVector< int > | detect (const Eigen::MatrixXd &matData, const Params ¶ms=Params()) |
| static QVector< int > | detectFlat (const Eigen::MatrixXd &matData, double dThreshold=1e-13) |
| static QVector< int > | detectHighVariance (const Eigen::MatrixXd &matData, double dZThresh=4.0) |
| static QVector< int > | detectLowCorrelation (const Eigen::MatrixXd &matData, double dCorrThresh=0.4, int iNeighbours=5) |
Automated detection of bad MEG/EEG channels using flat, variance, and correlation criteria.
Definition at line 108 of file bad_channel_detect.h.
Convenience alias so callers can still write BadChannelDetect::Params.
Definition at line 111 of file bad_channel_detect.h.
|
static |
Run all three detectors and return the union of bad channel row indices.
The order of the returned indices is ascending and each index appears at most once.
| [in] | matData | Data matrix (n_channels × n_samples), calibrated (SI units). |
| [in] | params | Detection parameters. |
Definition at line 93 of file bad_channel_detect.cpp.
|
static |
Detect flat (dead) channels.
A channel is flat if its peak-to-peak amplitude over the whole segment is < dThreshold.
| [in] | matData | Data matrix (n_channels × n_samples). |
| [in] | dThreshold | Minimum peak-to-peak amplitude (SI units). Default 1e-13 T (0.1 fT). |
Definition at line 115 of file bad_channel_detect.cpp.
|
static |
Detect high-variance (noisy) channels.
Computes the per-channel standard deviation, then flags any channel whose z-score (relative to the median and MAD across channels) exceeds dZThresh. Using the median/MAD makes the test robust to a few very bad channels.
| [in] | matData | Data matrix (n_channels × n_samples). |
| [in] | dZThresh | Z-score threshold (default 4.0). |
Definition at line 129 of file bad_channel_detect.cpp.
|
static |
Detect low-correlation (isolated) channels.
For each channel, computes the mean absolute Pearson correlation with its iNeighbours nearest channels on each side of the channel list. A channel is flagged if this mean falls below dCorrThresh.
This detector is most useful for sensor arrays where physically close channels share common signal; it is less meaningful for widely-spaced EEG reference montages.
| [in] | matData | Data matrix (n_channels × n_samples). |
| [in] | dCorrThresh | Minimum acceptable mean absolute correlation (default 0.4). |
| [in] | iNeighbours | Channels on each side (default 5). |
Definition at line 184 of file bad_channel_detect.cpp.