Detect bad: amplitude and gradient threshold function for EEG trials

Hello and thank you for your work on Brainstorm. I'm wondering if the function "Detect bad: amplitude and gradient threshold " could be broadened to include EEG trials. That is, feeding eeg trials to the function, it outputs error: Channel files "..." does not contain MEG sensors.

What are the steps you taking to run this process?

It seems that your parameters include MEG sensors, while your data is EEG.
Can you remove the MEG sensors from the parameters?

I'm using the GUI and feeding in EEG events. There is nowhere in the inputs to specify MEG versus EEG. I'm aware that the function was built for MEG data and wonder if it could be broadened to accommodate EEG data.

in function process_detectbad_mad.m
Lines 174 and 341 are dependent on 'MEG' channel labels.
Changing these to 'EEG' fixes the issue for me.
Would be helpful to edit so that the function could work with either or.

For EEG, you can use the process: Artifacts > Detect bad channels: peak-to-peak

Also, you can use the process: Events > Detect events above threshold, then set those events as bad, in that sense you would be detecting bad segments