Closed ingod closed 3 years ago
Be advised that
I have the same error, too. I'm sure that I executed this file under the Python 2 environment while "electrode_position.txt" and "Extract-Raw-Data-Into-Matlab-Files.py" are in the same folder. When I'm debugging, I found that this error happened in a strange place: ` 46 def load_edf_signals(path): 47 try: 48 print('333') 49 print(path) 50 ---->sig = pyedflib.EdfReader(path) 51 print('444') 52 n = sig.signals_in_file 53 signal_labels = sig.getSignalLabels() 54 sigbuf = np.zeros((n, sig.getNSamples()[0]))
55 for j in np.arange(n): 56 sigbuf[j, :] = sig.readSignal(j) 57 # (n,3) annotations: [t in s, duration, type T0/T1/T2] 58 annotations = sig.read_annotation() 59 except KeyboardInterrupt: 60 # prevent memory leak and access problems of unclosed buffers 61 sig._close() 62 raise
63 sig._close() 64 del sig 65 return sigbuf.transpose(), annotations `
In the Python's terminal at line 48, we can find that we have an output of '333' and the path, while '444' didn't appear, so I guess there are some errors happened in line 50 pyedflib.EdfReader(path)
.
Then I open Python2.7 and type the following code:
`
import pyedflib sig = pyedflib.EdfReader('/root/EEG-DL/dataset/S001R01.edf') Traceback (most recent call last): File "
", line 1, in File "pyedflib/_extensions/_pyedflib.pyx", line 116, in pyedflib._extensions._pyedflib.CyEdfReader.init File "pyedflib/_extensions/_pyedflib.pyx", line 155, in pyedflib._extensions._pyedflib.CyEdfReader.open File "pyedflib/_extensions/_pyedflib.pyx", line 127, in pyedflib._extensions._pyedflib.CyEdfReader.check_open_ok OSError: the file is not EDF(+) or BDF(+) compliant (Prefilter) `
This dataset is get from this project by using "MIND_Get_EDF.py", so I feel confused. Then I download the dataset from the new PhysioNet website and try to open the .edf files, but I failed. EDFbrower told me that both dataset download by the script or directly download from the website can not be opened. I tried to open the dataset by Matlab. This time I can open it, but I found that .edf files don't contain the EEG information. I wonder to know how to debug this problem. Thanks for helping and my apology for taking up your times.
I meet the same question, I found the edf can't be opened.
I have the same error, too. I'm sure that I executed this file under the Python 2 environment while "electrode_position.txt" and "Extract-Raw-Data-Into-Matlab-Files.py" are in the same folder. When I'm debugging, I found that this error happened in a strange place: ` 46 def load_edf_signals(path): 47 try: 48 print('333') 49 print(path) 50 ---->sig = pyedflib.EdfReader(path) 51 print('444') 52 n = sig.signals_in_file 53 signal_labels = sig.getSignalLabels() 54 sigbuf = np.zeros((n, sig.getNSamples()[0]))
55 for j in np.arange(n): 56 sigbuf[j, :] = sig.readSignal(j) 57 # (n,3) annotations: [t in s, duration, type T0/T1/T2] 58 annotations = sig.read_annotation() 59 except KeyboardInterrupt: 60 # prevent memory leak and access problems of unclosed buffers 61 sig._close() 62 raise
63 sig._close() 64 del sig 65 return sigbuf.transpose(), annotations `
In the Python's terminal at line 48, we can find that we have an output of '333' and the path, while '444' didn't appear, so I guess there are some errors happened in line 50
pyedflib.EdfReader(path)
. Then I open Python2.7 and type the following code: `import pyedflib sig = pyedflib.EdfReader('/root/EEG-DL/dataset/S001R01.edf') Traceback (most recent call last): File "", line 1, in File "pyedflib/_extensions/_pyedflib.pyx", line 116, in pyedflib._extensions._pyedflib.CyEdfReader.init File "pyedflib/_extensions/_pyedflib.pyx", line 155, in pyedflib._extensions._pyedflib.CyEdfReader.open File "pyedflib/_extensions/_pyedflib.pyx", line 127, in pyedflib._extensions._pyedflib.CyEdfReader.check_open_ok OSError: the file is not EDF(+) or BDF(+) compliant (Prefilter) `
This dataset is get from this project by using "MIND_Get_EDF.py", so I feel confused. Then I download the dataset from the new PhysioNet website and try to open the .edf files, but I failed. EDFbrower told me that both dataset download by the script or directly download from the website can not be opened. I tried to open the dataset by Matlab. This time I can open it, but I found that .edf files don't contain the EEG information. I wonder to know how to debug this problem. Thanks for helping and my apology for taking up your times.
Hi,
I'm sure I have met the same issue before when I'm working on the EEG job. Nevertheless, I cannot remember how I address it.
There are several suggestions as follows which might be helpful:
I think the above methods should solve your problem. However, if there is any other problem, please be sure to let me know or Google & Baidu it. I'm sure u can find a proper solution.
Best,
Shuyue
I meet the same question, I found the edf can't be opened.
Hi,
The problem of this issue might be the integrity of the downloaded EDF files. If u are in Mainland China, u should download the files using a VPN service. Otherwise, u should double-check your codes.
Best,
Shuyue
Hi, I have met the same question. Anyone who have solved the problem?
why closed this issue?
Please refer to Common Issues 5 in Readme, and in the command it is edf not def!!!
@Kang1121 have you solve this index out of range issu?
IndexError Traceback (most recent call last)