Processing OpenNeuro dataset: ValueError: Unknown mat file type, version 114, 46

  • MNE version: 1.7.1
  • operating system: macOS

I am using a openeuro dataset: OpenNeuro

And I am trying to process the dataset:

import os
import mne

Define the directory where the EEG data is stored

data_dir = os.path.join(os.path.expanduser(“~”), “Desktop”, “ImaginedEmotions”)
print(“Data directory:”, data_dir)

Define the participant number and create a formatted participant ID

participant_num = 1
participant = f’sub-{participant_num:02d}’
print(“Participant ID:”, participant)

Define the directory specific to the participant’s EEG data

participant_dir = os.path.join(data_dir, participant, ‘eeg’)
print(“Participant directory:”, participant_dir)

Define the path to the EEG file

eeg_file = os.path.join(participant_dir, f’{participant}_task-ImaginedEmotion_eeg.set’)
print(“EEG file exists:”, os.path.exists(eeg_file))

Check if the EEG file exists and, if so, load the data

if os.path.exists(eeg_file):
# Load the EEG data using MNE
raw = mne.io.read_raw_eeglab(eeg_file, preload=True)
print(“EEG data successfully loaded.”)
else:
print(“EEG file not found.”)

Error: ValueError: Unknown mat file type, version 114, 46

Please help,

Thank you

Hello, this might not be directly related to your problem, but: You should always use MNE-BIDS to read BIDS datasets (such as those form OpenNeuro) to ensure all metadata gets handled correctly.

How did you download the dataset? Are you sure the files aren’t corrupted?

Best wishes,
Richard