v2.0.0
Loading...
Searching...
No Matches
bad_channel_detect.h File Reference

Declaration of BadChannelDetect — automated detection of bad MEG/EEG channels. More...

#include "dsp_global.h"
#include <Eigen/Core>
#include <QVector>
Include dependency graph for bad_channel_detect.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  UTILSLIB::BadChannelDetectParams
 Bad-channel detection parameters (defined outside class to avoid Clang/GCC default-argument issues with nested structs). More...
class  UTILSLIB::BadChannelDetect
 Automated detection of bad MEG/EEG channels using flat, variance, and correlation criteria. More...

Namespaces

namespace  UTILSLIB
 Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).

Detailed Description

Declaration of BadChannelDetect — automated detection of bad MEG/EEG channels.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.1.0
Date
March 2026

Three complementary detection strategies are provided:

  1. Flat signal — channels whose peak-to-peak amplitude is below a minimum threshold over the whole segment (disconnected electrode, saturated ADC stuck at rail, etc.).
  2. High variance — channels whose standard deviation is more than dZThresh standard deviations above the median across channels (muscle artefact, loose connection, large drift).
  3. Low correlation — channels that correlate poorly with their neighbours in the channel list. A bad channel appears isolated: its Pearson correlation with the surrounding ±iNeighbours channels is below dCorrThresh. This catches channels with coherent but spurious signals that pass the variance test.

The three detectors can be run independently or combined via detect() which applies all three and returns the union of bad channel row indices.

Definition in file bad_channel_detect.h.