I am trying to write a generic BIDS importer for Brainstorm.
When testing this dataset: OpenNeuro
I realized that the channel names were not matching between the BIDS metadata _channels.tsv and _electrodes.tsv (e.g. “A1”) and the EEGLAB .set files that contain the header of the EEG data (e.g. “1A1”). Is it OK to use the _channels.tsv to rename the data channels?
According to the specs (Electroencephalography - Brain Imaging Data Structure v1.7.0): the file _channels.tsv is optional, and the order of the channels SHOULD be the same as in the original file.
This means that the dataset is valid if the order is different between the recordings file and the _channels.tsv, or if not all the recorded channels are documented in the metadata. Therefore renaming the channels with the _channels.tsv is unsafe.
I would tend not to allow it in my importer, however it means that I can’t import the positions of the electrodes defined in the _electrodes.tsv.
In this older dataset, there is a .fdt file, and in the .set file the channel are labelled as “1A1”, “1A2”, etc. instead of “A1”, “A2”…
No problem with the current version 1.1.0.
Thank you for pointing at this PR.
All the discussed variants explain well that the BIDS metadata can’t be used to modify intentionally the information existing in the data files. The only discussed exception is a lack of technical possibility to represent the exact same information on both sides.
Since channel names are expected to be char arrays with only printable characters, I don’t see how any discrepancy could happen. I think we can therefore consider that the BIDS metadata can’t be used to rename the channels.
If the channel names differ between the BIDS metadata and the EEG/MEG data files, this should be reported as an error.
Conclusion: I will not make the extra effort to consider in the Brainstorm BIDS importer the case where channel renaming occurs.