MIT-LCP / wfdb-python

Native Python WFDB package
MIT License
730 stars 298 forks source link

handling local headers of mit bih database #475

Closed Cheppy closed 2 months ago

Cheppy commented 7 months ago

this would save time when working locally with mit-bih database

bemoody commented 7 months ago

Please explain what you're trying to do. The change you're suggesting does not make any sense to me.

Cheppy commented 7 months ago

Please explain what you're trying to do. The change you're suggesting does not make any sense to me.

Greetings, what I am trying to do: There is open ECG database that is most commonly used to train datasets, or to check accuarcy of "own methods" for peak detection: https://www.physionet.org/content/mitdb/1.0.0/ The wfdb package currently only recognizes header files with the .hea extension, but the MIT-BIH database uses the .dat.hea format. To avoid renaming of headers or writing a script to rename them, I'm proposing a way to handle the case with .dat.hea files directly within wfdb. This will help saving time and effort for those working with that database. and i think it would be nice idea, because MIT-BIH is commonly used in many scientific papers. Maybe my way of handling that is too simple, but i hope you got the idea. What you think, should this case be added to wfdb?

bemoody commented 6 months ago

Header files just have a .hea extension - 100.dat.hea is not valid. For example, the header file for record 100 is 100.hea.

You can load this record using wfdb.rdrecord(record_name="100", pn_dir="mitdb/1.0.0").

Or, if you have downloaded the files 100.hea and 100.dat, you can use wfdb.rdrecord("100").

I don't know where you found ".dat.hea" files; there aren't any on PhysioNet.