While exploring how to exclude bad segments, epochs, trials, etc. from a process, I saw that for raw epoched data there is a flag for bad epochs, DataMat.F.epochs.bad, that seems to be only read for a few file types, and I couldn't really find how it is dealt with elsewhere. In particular, while the function panel_record('GetBadSegments' finds bad segments as defined by events, it doesn't seem to take into account those bad epochs.
That brings me to my questions:
Should GetBadSegments take the bad epochs into account? I would think so.
Should we simplify this by generating events for these bad epochs when reviewing the raw file?
The CTF format has such bad epochs (in the file ClassFile.cls) and even bad segments (in the file bad.segments), but they are currently not read by Brainstorm. Is this something we want to do?
Are there other ways to identify bad data that I might have missed? I saw that imported trials can also be flagged as bad and that they are excluded from the process panels so that's ok. Channels can also be flagged, but I'm not considering those here. Did I miss something else?
Indeed, this field is not much used in Brainstorm.
It is read from two file formats (EEGLAB .set and EGI .raw) for data that is already fully pre-processed and epoched. These files should not be imported as "raw continuous" but directly as epochs in Brainstorm (using menu "Import MEG/EEG" instead of "Review raw file"), because there is not much that can be done with them otherwise. Therefore I can't see any use case where it would useful for the function GetBadSegment to retreive this info...
When importing EEGLAB .set or EGI .raw files as epochs, the epoch(i).bad info is used to mark the imported trial as good or bad in the Brainstorm database:
The CTF format has such bad epochs (in the file ClassFile.cls) and even bad segments (in the file bad.segments), but they are currently not read by Brainstorm. Is this something we want to do?
No one ever requested this, so I'm not sure it is worth investing time in it.
Do you have any clear use case in which there is some important information that is missing in the CTF recordings as currently processed by Brainstorm?
Please test the timing of the new BAD events carefully: I don't have any example dataset where this file bad.segments is not empty, therefore I can't test it myself.
Thanks