Amplitude thresholds across all channels

Hello. I am currently in the process of converting my in-lab processing pipeline from BESA to Brainstorm. One of the parts of this pipeline is checking all channels if they cross a certain threshold (top right of image from BESA):

So far I've managed to see that I can set a std based threshold, however, I can only do it for selected channels. Is there a way to detect this across all channels?

Thanks!

Brainstorm offers two process that works for all the channels at the same time:

  • Detect other artifacts: But this doesn't let you set specific thresholds
  • Detect bad channels: peak-to-peak: But this works with absolute peak-to-peak amplitudes, not std-based thresholds

The process Detect custom events lets you run a detection based on the deviation higher than the std over the entire signal, but only a given channel.

I think what you need is missing, but could be added if you feel like getting a bit involved in the development. You can probably mix and match bits of existing code to create a new process, or try to extend an existing process. You could share your contribution on the brainstorm github repository if you're interested.
If you are, start by looking at the existing code, and let me know if you need more help from us.

https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting
https://neuroimage.usc.edu/brainstorm/Tutorials/TutUserProcess

1 Like

Thanks for the reply. I can take a look at the code, and see if I can contribute. Btw, I am unable to find how I can do Detect bad channels: peak-to-peak. If you could, please point me to the right tutorial or just where it is in the toolbar.

As a meta-discussion, this is something I haven't really questioned: does it make sense to do the analysis without this thresholding step? Judging from the tutorials and the general approach, looking at the butterfly plots of epochs would substitute this step. If there are any funky deflections, they'll be very apparent. Do you think this line of reasoning is sound?

Btw, I am unable to find how I can do Detect bad channels: peak-to-peak . If you could, please point me to the right tutorial or just where it is in the toolbar.

It is not available in the interactive interface.
Select the files you want to process in Process1 (only imported files, no "Link to raw files"), then select the process Artifacts > Detect bad channels: peak-to-peak.

does it make sense to do the analysis without this thresholding step? Judging from the tutorials and the general approach, looking at the butterfly plots of epochs would substitute this step. If there are any funky deflections, they'll be very apparent. Do you think this line of reasoning is sound?

Yes, it does make sense not using any fixed threshold. If you have a lot of repetitions for all your ERPs, you could even go without any cleaning or rejection at all. The amount of rejection/cleaning you decide to apply on your data should depend on the data quality, the amount of data available, and the expected output. We don't think that one generic pre-processing pipeline could work efficiently for all the experiments. You will probably need a few trial and errors to find the best solution for your data.

1 Like

Thank you for the reply, fixed thresholds always seem to rub me the wrong way, so I kinda like this approach.