EEG data in .edf not converting in volt

If you have a question or issue with MNE-Python, please include the following info:

  • MNE-Python version: 0.22.0
  • operating system: Windows 10

Hi MNE
I am a new user working on EEG data. I am using my own data using LabChart, but the microVolt is not converting to default Volt and showing a large amplitude data.

raw4=mne.io.read_raw_edf(‘subject_data.edf’)
print(raw4.info)
raw4.plot()

the desired result is -18.2063 microvolt
output=-18.2063V

you mean the data is not converted to V properly on read?

if so how did you produce this edf file? can you share it with us?

Alex

it seems you file contains data in uV, but MNE is treating it as V. something is off either during reading or writing this file…

Thank you, yes, my data is in uV. How can I change it to volt? I tried to change using variable explorer but the save and change button is off.

MNE should automatically detect that it’s in µV, and treat it accordingly. Since this is not happening, we either have a bug in MNE, or something is wrong with your file. Could you please share the file, like @agramfort suggested, and let us know how you produced the file? Is that a LabChart export?

Where to share the .edf file? It is not supported for uploading here. Yes, I extracted the data from LabChart.

share the file on a different service (dropbox, google drive…)

A

eeg_data_raw4

I confirm the behavior of mne but I would need someone to test with another reader to
see if it’s an issue with the file or the reader

Alex

1 Like

I just tried reading it with PyEDFlib:

import pyedflib

fname = 'mne-python/EDF/subject 2 trial 1(5).edf'
f = pyedflib.EdfReader(fname)

This fails:

pyedflib/_extensions/_pyedflib.pyx in pyedflib._extensions._pyedflib.CyEdfReader.__init__()

pyedflib/_extensions/_pyedflib.pyx in pyedflib._extensions._pyedflib.CyEdfReader.open()

pyedflib/_extensions/_pyedflib.pyx in pyedflib._extensions._pyedflib.CyEdfReader.check_open_ok()

OSError: mne-python/EDF/subject 2 trial 1(5).edf: the file is not EDF(+) or BDF(+) compliant (Physical Dimension)

So I’m leaning towards saying, the file itself is the problem.

In either case, MNE does not refuse to read the file, and reports µV in raw._orig_units after reading. So I would consider this a bug in MNE: either it shouldn’t read the file at all and throw an error, or it should treat the encountered unit scalings correctly. Looking into this right now.

1 Like

Thank you. After the conversion of .edf to .mat format, data is plotting correctly in EEGLAB.

1 Like

This will be fixed soon in Support µV in EDF files (in addition to uV) by Sumalyo · Pull Request #9187 · mne-tools/mne-python · GitHub.

1 Like

@Shalukshetri This has been fixed in the main development branch of MNE-Python. You can install it via:

pip install -U https://github.com/mne-tools/mne-python/archive/refs/heads/main.zip

Or just pip install -U mne.

I thought it hadn’t been backported…?

My bad - of course you are right, we didn’t backport. Sorry for the noise!