Missing EEG Channel Names When Importing FIF/BIDS Files from NeuroMag
Problem Summary:
Multiple centers have encountered a recurring issue when importing .fif files into Brainstorm: the EEG channel names are not properly retained or imported. This is particularly evident with data originating from NeuroMag systems, where the channel labels either appear as generic names or are entirely missing.
Suggested Solutions:
To address this issue and improve interoperability with .fif data:
- Enhancement During Import:
Add an option during the import process to replace standard channel names using a user-specified mapping file (e.g., .csv or .txt).
This file would contain a simple mapping (e.g., EEG001 → Fp1, EEG002 → Fz, etc.).
- Post-Import Channel Editing:
Add a right-click context menu option on the channel file (in the Brainstorm GUI) to "Replace Channel Names from Mapping File".
This would allow retrospective correction of channel names after the data has already been imported.
Currently, process_import_bids.m comments contain the following DISCUSSION:
% - Metadata conflicts:
% - Channel names are kept from the original data files, and can't be renamed with the BIDS metadata.
% This simplifies a lot the implementation, as we can keep on using the original channel file and add the extra info from _channels.tsv and _electrodes.tsv.
% This is not aligned with the idea that "In cases of conflict, the BIDS metadata is considered "
% But the channel names are never expected to be different between the data files and the metadata:
% "If BIDS metadata is defined, format-specific metadata MUST NOT conflict to the extent permitted by the format"
% (reference: https://github.com/bids-standard/bids-specification/pull/761)
We need to modify its behavior such that for non-MEG channels, we perform "Post-Import Channel Editing" by:
- Reads the channel names and channel units from the BIDS sidecar
_channels.tsv - Reads the electrode location from BIDS sidecar
_electrodes.tsv
Please note, that for MEG channels FIF file should be considered authoritative.
Thanks @yashvakilna
@chinmaychinara91 can you please check this and compare it with your current scripts?
@chinmaychinara91 any updates on this issues?
Based on the discussion with with @yashvakilna and Michelle today and adding to the yash's https://github.com/brainstorm-tools/brainstorm3/issues/802#issuecomment-2963851225 above:
When importing FIF files through process_import_bids, for non-MEG (here EEG) channels, two post processing steps are required:
- Renaming the
EEGxxxchannel names to the proper ones as provided in the_channels.tsvfile - Update the locations for the EEG channels from
_electrodes.tsv. The reason we do this is because the locations in the FIF file may have error but_electrodes.tsvwill have the most accurate locations.
@yashvakilna, @chinmaychinara91, @tmedani, was this was solved with #810? If so we can close the issue.
Yes we can. It has been solved in #810