-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when reading an EDF file (resampling) #12897
Comments
The bug seems to be specific to that certain EDF-file. Without a file to reproduce I'm at loss :-/ Can you create an anonymized version of the EDF with from pyedflib import highlevel
signals, signal_headers, header = highlevel.read_edf('input.edf')
# scramble data, this should basically destroy any information contained
random_signals = [np.random.choice(sig, len(sig)) for sig in signals]
# Alternatively: Completely random data with same shape as existing signals
# random_signals = [np.random.unform(min(sig), max(sig), len(sig)) for sig in signals]
# Update headers for anonymization
header['patientname'] = 'anonymous'
header['patient_additional'] = 'anonymous'
header['recording_additional'] = 'anonymous'
header['equipment'] = 'anonymous'
header['admincode'] = 'anon'
header['annotations'] = []
# Create an output EDF file with random data
highlevel.write_edf('output.edf', random_signals, signal_headers, header) |
Unfortunately, I do not have the file either. The original reporter in the forum says he can't share the file, but it seems to happen with one specific channel only. However, I already mentioned that this might make it impossible for us to fix the problem. |
Hi, @skjerns . I made an anonymized version with two signals: "working_ch" and "failing_ch". |
Can reproduce. Will look into it. Workaround is to use import mne
edf = mne.io.read_raw_edf("my/edf/file.edf", preload=True)
out = edf.get_data(picks=["my_channel"], return_times=False) |
commenting to follow up on this. |
@h-mayorquin you don't have to comment if you want to follow a PR/issue, there's a "Subscribe" button for this purpose. |
From the forum:
This might have been introduced by #11549.
@skjerns do you have time to take a look?
The text was updated successfully, but these errors were encountered: