I have been encountering issues when loading a BIDS data set using the mne_bids.read function. My dataset is composed of both ieeg and eeg data for some patients, while other only have ieeg data. Surprisingly, when loading the ieeg data for a patient for whom we only had ieeg data, the channel types of the loaded data is set properly. However, for the patient in whom we have both ieeg and eeg data, the channel type is not set. I am not sure what is the reason behind this. Perhaps the data type not being transferred to the function reading the channel type, leading to the eeg channels.tsv being read instead of the ieeg one?
My directory structure is something like this:
C:.
Ā±āsub-101
| āses-V1
| |āeeg
| āieeg
Ā±āsub-102
| āses-V1
| |āeeg
| āieeg
Ā±āsub-103
āses-V1
āieeg
I am unfortunately not able to share actual data due to data privacy issues.
This behavior indeed does sound like a bug. Do you think you could share some made-up data that allows us to reproduce the issue? This would simplify debugging on our end a lot.
Turns out, it was a bit easier than expected. Here are the data + code: KEEPER
In the attached folder, you will find the following structure:
bids
|ā sub-SAMPLE1
āsub-SAMPLE2
\code
The bids data were generated using the script generate_simulated_raw.py. I generated the subject SAMPLE1 to have eeg, ecog, seeg and ecg channels (to be fully equivalent to my actual data) while SAMPLE2 has only ieeg data.
The data were then read and plotted using load_raw_bids. For SAMPLE2, things work fine, whereas for SAMPLE1, the following warnings are displayed: RuntimeWarning: Expected to find a single events file associated with sub-SAMPLE1_ses-V1_task-TEST, but found 2: RuntimeWarning: Expected to find a single channels file associated with sub-SAMPLE1_ses-V1_task-TEST, but found 2:
It therefore seems that in the scenario where one has multiple data types for the same subject in the same bids data set, the bids reader search for the different sidecar files regardless of the data type.
I hope this makes it clearer. Please let me know if there is anything else required
Hello, the fix isnāt ready for integration into the main development branch yet, but I will let you know once it is. Youāll have to wait for a few days though, Iām afraid!