You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow overwriting incorrect units in EDF header with mne.io.read_raw_edf #14427
An EDF file I have has some channels that are in arbitrary units (i.e. misc channels) but the header incorrectly specifies uV. There appears to be no easy way to fix this in MNE directly: I'll need to correct the header externally.
This causes downstream issues when exporting to EDF because the range now has too many characters to fit in an EDF header field (edfio gives up).
Describe your proposed implementation
Would it be possible to update the units parameter of mne.io.read_raw_edf to allow over-writing an existing unit? Currently, this raises an error: only units that are unspecified in the EDF header are allowed to be modified on opening them.
Describe possible alternatives
Using an external tool to fix the header. This is annoying because I expected this to be possible with just MNE.
Would it be possible to update the units parameter of mne.io.read_raw_edf to allow over-writing an existing unit? Currently, this raises an error: only units that are unspecified in the EDF header are allowed to be modified on opening them.
I'm +1 for this. @raj-magesh are you open to submit a PR?
Hi! I'd like to work on this issue and submit a PR.
I'll investigate the existing EDF unit conversion and scaling logic, implement support for explicitly overriding existing channel units, and add regression tests to ensure existing behavior remains intact.
Please let me know if you have any particular implementation preferences.
Activity
scott-huberty commentedon Oct 16, 2026
I'm +1 for this. @raj-magesh are you open to submit a PR?
raj-magesh commentedon Oct 16, 2026
Sure, I'll try to get to this when I have the time. Currently, I've just edited the header directly with
edfioas a workaround.Famous077 commentedon Nov 6, 2026
Hi @scott-huberty @raj-magesh , Is there anyone working on this issue? if no, then Can I start working on it.
raj-magesh commentedon Nov 6, 2026
I'm not working on it currently. Feel free to take over!
divya-git03 commentedon Nov 19, 2026
Hi! I'd like to work on this issue and submit a PR.
I'll investigate the existing EDF unit conversion and scaling logic, implement support for explicitly overriding existing channel units, and add regression tests to ensure existing behavior remains intact.
Please let me know if you have any particular implementation preferences.