A user reported that they were unable to load WFDB files with .mat file extensions, e.g., from the PhysioNet Challenge 2020:
https://physionet.org/content/challenge-2020/1.0.2/training/georgia/g1/#files-panel
I suspect that the find_records function is causing this problem:
|
def find_records(folder, output_dir): |
There are at least three issues to fix:
- This function hard-codes the signal filename extensions. It should load the signal filenames from the header files.
- It associates the signal files with header files by sorting the filenames, assuming that the order of the sorted filenames provides a pairing of the header and signal files. It should load the signal filenames from the header files.
- It uses platform-specific path separators to separate and join file paths, e.g.,
/ vs \. It should use the built-in functions from os.path.
A user reported that they were unable to load WFDB files with .mat file extensions, e.g., from the PhysioNet Challenge 2020:
https://physionet.org/content/challenge-2020/1.0.2/training/georgia/g1/#files-panel
I suspect that the
find_recordsfunction is causing this problem:ecg-image-kit/codes/ecg-image-generator/helper_functions.py
Line 30 in 27b90f5
There are at least three issues to fix:
/vs\. It should use the built-in functions fromos.path.