I'm working on 5 min EEG segments * 256 channels. I marked as bad just few channels for short time windows (using linked data). If I import data as "continuous", all bad channels (also the ones marked as bad for a short amount of time) are removed. Thus, I imported "epoched" data (time window 6 sec) BUT if the bad channels are marked as bad for almost all the epoch, it is impossible to compute the PSD. Why?
I cleaned the linked raw file as a continuous file using the option 'mark as bad' for individual channels
I imported the segment splitting it in 40 blocks of 6 second each
In other words, I cleaned the 4 minute segment as a continuous file (bc I work in the sleep field and it is easier for me to visualize 30 sec epochs), and I would like to put Nan to few specific channels in different blocks, and for each block I want to compute a separate psd. I know it might sound unconventional, but this is the only reasonable way to clean and use the segments I have.
It seemed to work but crashed for one segment where the sum of 3 different bad artifacts spanned across all the block.
More specifically, for the block 180-186 sec (the one selected in the screenshot) I couldn't generate the PSD. I succeed only when I removed the first bad segment - spanning from 180 to 182 sec. As you can see from the screenshot the other 2 remaining segments span from 182 to 186 sec, meaning that I had bad segments along ALL the 180-186 segment (but marked just for few channels).
if it overlaps with at least one bad segment defined for all the channels, the entire epoch is marked as bad (red dot in the database explorer)
if it overlaps with at least one bad segment defined only on one or a few channels, this channel is marked as bad for the entire epoch (ChannelFlag(iBad)=-1).
It seemed to work but crashed for one segment where the sum of 3 different bad artifacts spanned across all the block.
Now I understand what happens.
The PSD computation was excluding entirely the channel-specific bad segments, which is silly for imported epochs because the channels are already marked as bad and would not be computed anyway.
I changed this logic: now the PSD computation includes the bad segments that are defined only for a few channels.