MNE BIDS montage standard?

Dear community:

I give you details of version below.

  • MNE version: latest dev version
  • operating system: macOS 12.2 sonoma

And details of the error. I am working on a database of epilepsy Temple University EEG Corpus - Downloads

I am trying to convert the data to BIDS format.

My problem is the montage. I assumed it is 10/20. But I think it is not. I don’t know in your expertise if you can help me with the type of standard montage from your software I should select or if it’s necessary to create it from this file. Or I can import it somehow?

[Montage]
montage = 0, FP1-F7: EEG FP1-LE – EEG F7-LE
montage = 1, F7-T3: EEG F7-LE – EEG T3-LE
montage = 2, T3-T5: EEG T3-LE – EEG T5-LE
montage = 3, T5-O1: EEG T5-LE – EEG O1-LE
montage = 4, FP2-F8: EEG FP2-LE – EEG F8-LE
montage = 5, F8-T4: EEG F8-LE – EEG T4-LE
montage = 6, T4-T6: EEG T4-LE – EEG T6-LE
montage = 7, T6-O2: EEG T6-LE – EEG O2-LE
montage = 8, A1-T3: EEG A1-LE – EEG T3-LE
montage = 9, T3-C3: EEG T3-LE – EEG C3-LE
montage = 10, C3-CZ: EEG C3-LE – EEG CZ-LE
montage = 11, CZ-C4: EEG CZ-LE – EEG C4-LE
montage = 12, C4-T4: EEG C4-LE – EEG T4-LE
montage = 13, T4-A2: EEG T4-LE – EEG A2-LE
montage = 14, FP1-F3: EEG FP1-LE – EEG F3-LE
montage = 15, F3-C3: EEG F3-LE – EEG C3-LE
montage = 16, C3-P3: EEG C3-LE – EEG P3-LE
montage = 17, P3-O1: EEG P3-LE – EEG O1-LE
montage = 18, FP2-F4: EEG FP2-LE – EEG F4-LE
montage = 19, F4-C4: EEG F4-LE – EEG C4-LE
montage = 20, C4-P4: EEG C4-LE – EEG P4-LE
montage = 21, P4-O2: EEG P4-LE – EEG O2-LE
montage = 22, EKG: EEG EKG-LE

(mne) andraderenew@Renes-MacBook-Air ~ % python3 /Users/andraderenew/Downloads/TUH_EEG/convert_eeg_to_bids.py
Extracting EDF parameters from /Users/andraderenew/Downloads/TUH_EEG/aaaaaaac-s002_2002_12_23-02_tcp_le/aaaaaaac_s002_t000.edf…
EDF file detected
Setting channel info structure…
Creating raw.info structure…
Traceback (most recent call last):
File “/Users/andraderenew/Downloads/TUH_EEG/convert_eeg_to_bids.py”, line 109, in
raw.set_montage(montage)
File “”, line 12, in set_montage
File “/Users/andraderenew/.local/lib/python3.11/site-packages/mne/_fiff/meas_info.py”, line 427, in set_montage
_set_montage(info, montage, match_case, match_alias, on_missing)
File “/Users/andraderenew/.local/lib/python3.11/site-packages/mne/channels/montage.py”, line 1258, in _set_montage
_on_missing(on_missing, missing_coord_msg)
File “/Users/andraderenew/.local/lib/python3.11/site-packages/mne/utils/check.py”, line 1171, in _on_missing
raise error_klass(msg)
ValueError: DigMontage is only a subset of info. There are 33 channel positions not present in the DigMontage. The channels missing from the montage are:

[‘EEG FP1-LE’, ‘EEG FP2-LE’, ‘EEG F3-LE’, ‘EEG F4-LE’, ‘EEG C3-LE’, ‘EEG C4-LE’, ‘EEG A1-LE’, ‘EEG A2-LE’, ‘EEG P3-LE’, ‘EEG P4-LE’, ‘EEG O1-LE’, ‘EEG O2-LE’, ‘EEG F7-LE’, ‘EEG F8-LE’, ‘EEG T3-LE’, ‘EEG T4-LE’, ‘EEG T5-LE’, ‘EEG T6-LE’, ‘EEG FZ-LE’, ‘EEG CZ-LE’, ‘EEG PZ-LE’, ‘EEG OZ-LE’, ‘EEG PG1-LE’, ‘EEG PG2-LE’, ‘EEG EKG-LE’, ‘EEG SP2-LE’, ‘EEG SP1-LE’, ‘EEG RLC-LE’, ‘EEG LUC-LE’, ‘EEG 30-LE’, ‘EEG T1-LE’, ‘EEG T2-LE’, ‘PHOTIC PH’].

Consider using inst.rename_channels to match the montage nomenclature, or inst.set_channel_types if these are not EEG channels, or use the on_missing parameter if the channel positions are allowed to be unknown in your analyses.

Thank you for all the help in advance.

Rene Andrade.

Hello,

The montage looks like standard 10/20, but the channel name EEG F3-LE are not. The standard 10/20 montage will contain channel names: F3, Fp1, C3, … and will try to match your recording to those names. Thus, you should first rename the channels in your recording to match the montage channel names with raw.rename_channels(...).

Mathieu

1 Like

thank you so much. I know it is a bipolar montage linked ears. That’s LE name for. I will rename the channels then.

I have done so but I have another issue. I don’t know what to do with events file I use rest as name suggested for task. But I don’t understand what is it supposed to find in eeg file?

<Annotations | 0 segments>
Extracting EDF parameters from /Users/andraderenew/Downloads/TUH_EEG/aaaaaaac_s002_t000.edf…
EDF file detected
Setting channel info structure…
Creating raw.info structure…
Writing ‘/Users/andraderenew/Downloads/TUHBIDS/README’…
Writing ‘/Users/andraderenew/Downloads/TUHBIDS/participants.tsv’…
Writing ‘/Users/andraderenew/Downloads/TUHBIDS/participants.json’…
Writing ‘/Users/andraderenew/Downloads/TUHBIDS/sub-aaaaaaac/eeg/sub-aaaaaaac_space-CapTrak_electrodes.tsv’…
Writing ‘/Users/andraderenew/Downloads/TUHBIDS/sub-aaaaaaac/eeg/sub-aaaaaaac_space-CapTrak_coordsystem.json’…
/Users/andraderenew/Downloads/TUH_EEG/convert_eeg_to_bids.py:192: RuntimeWarning: No events found or provided. Please add annotations to the raw data, or provide the events and event_id parameters. For resting state data, BIDS recommends naming the task using labels beginning with “rest”.
write_raw_bids(raw, bids_path, overwrite=True)
Writing ‘/Users/andraderenew/Downloads/TUHBIDS/dataset_description.json’…
Writing ‘/Users/andraderenew/Downloads/TUHBIDS/sub-aaaaaaac/eeg/sub-aaaaaaac_task-rest_eeg.json’…
Writing ‘/Users/andraderenew/Downloads/TUHBIDS/sub-aaaaaaac/eeg/sub-aaaaaaac_task-rest_channels.tsv’…
Copying data files to sub-aaaaaaac_task-rest_eeg.edf
Writing ‘/Users/andraderenew/Downloads/TUHBIDS/sub-aaaaaaac/sub-aaaaaaac_scans.tsv’…
Wrote /Users/andraderenew/Downloads/TUHBIDS/sub-aaaaaaac/sub-aaaaaaac_scans.tsv entry with eeg/sub-aaaaaaac_task-rest_eeg.edf.
|TUHBIDS/
|— README
|— dataset_description.json
|— participants.json
|— participants.tsv
|— sub-aaaaaaac/
|------ sub-aaaaaaac_scans.tsv
|------ eeg/
|--------- sub-aaaaaaac_space-CapTrak_coordsystem.json
|--------- sub-aaaaaaac_space-CapTrak_electrodes.tsv
|--------- sub-aaaaaaac_task-rest_channels.tsv
|--------- sub-aaaaaaac_task-rest_eeg.edf
|--------- sub-aaaaaaac_task-rest_eeg.json
Traceback (most recent call last):
File “/Users/andraderenew/Downloads/TUH_EEG/convert_eeg_to_bids.py”, line 201, in
counts = count_events(bids_root)
^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/andraderenew/.local/lib/python3.11/site-packages/mne_bids/stats.py”, line 120, in count_events
raise ValueError(“No events files found.”)
ValueError: No events files found.