Trial-specific bad channels

I have marked epileptic discharges as channel-specific bad segments in a raw file. When I import my data, the channels marked bad vary from trial to trial, but I have no completely bad trials (at least some channels are good in every trial). I have 100 trials. When I compute the average across trials (ERP), my understanding is that although all 100 trials were incorporated into the average, the bad channels were excluded when appropriate.

My question: Is it possible to tell post-hoc how many trials went into each channel's calculation? Or do I need to simply count up how many bad trials there were for each channel individually?

Many thanks!

Best,
Dan

Hi @dweisholtz,

Yes, this is correct. For each epoch, channels that overlap with a channel-specific bad segment are ignored for the average.

Yes, it is possible with a simple script. The idea is to open the ChannelFlag for each epoch and count how many times channels appear as Good.

You can generate a script to generate the average across epochs.
https://neuroimage.usc.edu/brainstorm/Tutorials/PipelineEditor#Saving_a_pipeline

Then modify it to have the channels counted as in this script:
https://gist.github.com/rcassani/bd347e6b2a8707b98052072b0eb30f00

Best,
Raymundo