Bad Sensors
MEGIN Systems
Bad sensors can significantly affect the (pre)processing steps. In MEGAP, the find_bad_channels_maxwell function from the MNE library is used to identify bad sensors for MEGIN system. The parameters for this step are the same as those used in the pipeline's tSSS stage. These parameters can be found in the "bad_channel_maxwell" section of the configuration file.
"bad_channel_maxwell": {
"int_order": 8,
"ext_order": 3,
"limit" : 7,
"min_count" : 5,
"duration": 20.0,
"return_scores" : true,
"coord_frame": "head"
},
The locations of bad sensors and their scores are plotted and saved in the /plot_bad_channel
folder. Additionally, the names of the bad channels are displayed on the right side of each plot.

CTF/BTI Systems
For CTF and BTI devices, where Maxwell filtering isn't available, bad sensors are identified using several methods:
Deviation: Detects channels with unusually high or low overall amplitudes.
Correlation: Identifies channels that don't correlate with others.
High Frequency Noise: Detects channels with excessive high-frequency noise.
RANSAC: Finds channels that are poorly predicted by other channels.
SNR (Signal-to-Noise Ratio): Flags channels with low SNR, which are bad in both high-frequency noise and low correlation.
These methods, from the PyPREP on bad channel detection, help in identifying and excluding problematic channels for cleaner data analysis. The threshold for these bad channel detection methods can be adjusted in the "bad_channel_nonmaxwell" section of the configuration file.
"bad_channel_nonmaxwell": {
"deviation_thresh" : 5,
"correlation_thresh": 0.4,
"hf_thresh": 5,
"snr_enabled" : true
},
Warning on Number of Bad Sensors
In the MEGAP, a warning is triggered if the number of bad sensors exceeds a defined threshold. This threshold is set in the config_pipeline.cfg file. When the number of bad sensors for each coil type (mag or grad) goes beyond the limit, the warning is saved in the /warning
folder within the results directory.
Last updated