Closed Lucas-Mc closed 2 years ago
Quite a list! I'm not sure they are all worth implementing though; especially as there are other tools in the Python ecosystem. My thoughts are that wfdb-python should focus on the I/O between WFDB compatible records and Python. Looking at the list:
plot2d
, plot3d
, plotstm
, plt
, pltf
, imageplt
, lwcat
, pschart
, psfd
can all be done by existing tools once the data is in Python (or aren't relevant if using Python)coherence
, dfa
, nguess
, sqrs125
, tach
, ecgpuwave
, ecgeval
, wave
, wabp
- all various types of ECG signal processing, which again seems like it could be separate from this packagefft
, fir
, lomb
, mfilt
, memse
- scipy signal processing functions which I know already existI am interested in the wfdbmap
function. But I am not sure if I can do the implementation. I would like some guidance as I have never done anything like this before. Like, where do I find the source code, lol?
Hey @AbdulAlkurdi, thanks for the suggestion! Here is where you can find the documentation and source code if you want a go at it! 👍
I agree @alistairewj, too many which can be easily done in Python instead of C or from external packages after the conversion! I'll add check marks to the ones you stated though I think ecgpuwave
has gained some interest here #75 #134 #136. Any thoughts?
Hmm, feels like it would be better served by a dedicated package to ECG analysis, e.g. something like ecg-kit (MATLAB) but in Python.
The closest one I know of is BioSPPy - have only briefly used it myself but seems to fulfill the role!
We do have an energy based QRS detector (mostly because @cx1111 was interested in implementing one), so we could consider adding a wavelet based QRS detector. I'd say it's not at all a necessity, just a fun side project, so it's really only worth it if it interests you.
@Lucas-Mc, @alistairewj, there are a number of packages dedicated to biosignal processing (including ECG and PPG). Neurokit presents a comprehensive overview. Maybe pointing users to those packages would be an option to prevent feature creep in wfdb
(i.e., adding non-IO related features)?
Hey @JanCBrammer, it looks like you are a developer for Neurokit
.. do you have any functions off the top of your head that would cover any of these before I look at the overview?
@Lucas-Mc, the overview I was referring to is an attempt to gather all packages in the Python and Matlab ecosystem that deal with biosignal processing. I don't know from the top of my head where in those packages to locate the signal processing functions that you listed above. But I'm sure that collectively the packages cover a lot of ground :)
Yeah I agree something like ecgpuwave
is useful but it feels out of scope as mentioned by @JanCBrammer. So probably what makes the most sense is the following:
Given this, looking back at your list, I'd check off the following as being out of scope: ecgpuwave
, edr
, gqfuse
, hrfft
, hrlomb
, hrmem
, hrstats
, ihr
, log10
, nst
, pnnlist
, pNNx
, stepdet
, wqrs
Awesome, thanks @alistairewj, this brings us down to 40 functions! I didn't know about awesome repositories
and that's going to save a lot of time when trying to find packages to link to! Also, thanks @JanCBrammer for your suggestions as well! 👍
I'm going to close wfdbmap
since the plot_wfdb
function is close enough and I can't seem to get plt
to compile on Mac anyway.
I think it's also safe to say that AHA format isn't really used anymore so I'll remove all of those!
Is there a timeline / expected date when the bxb
function will be implemented in Python?
Is there any work already ongoing?
Is there a timeline / expected date when the
bxb
function will be implemented in Python? Is there any work already ongoing?
Good question! Please create a separate issue so we can discuss the specifics of how that function ought to work.
Going to close this. We can use individual issues for high-yield functions to be ported over.
A to-do list of the remaining functions from the original C code still left to implement:
coherence: estimate coherence and cross-spectrum of two time seriesdfa: detrended fluctuation analysisecgeval: generate and run ECG analyzer evaluation scriptecgpuwave: QRS detector and waveform limit locator #75 #134 #136edr: derive a respiration signal from an ECGfft: fast Fourier transformfir: general-purpose FIR filter for WFDB recordsgqfuse: combine QRS annotation fileshrfft: calculate the heart rate FFThrlomb: calculate the heart rate Lomb periodogramhrmem: calculate and plot heart rate power spectrahrstats: collect and summarize heart rate statistics from an annotation fileihr: calculate instantaneous heart rateimageplt: plot a greyscale imagelog10: calculate common logarithms of two-column datalomb: estimate power spectrum using the Lomb periodogram methodlwcat: postprocess output of plt to make PostScript, EPS, PDF or PNGmemse: estimate power spectrum using maximum entropy (all poles) methodmfilt: general-purpose median filter for WFDB recordsnguess: guess the times of missing normal beats in an annotation filenst: noise stress test for ECG analysis programsplot2d: make 2-D plots from text files of data, using gnuplotplot3d: make 3-D plots from text files of data, using gnuplotplotstm: produce scatter plot of ST measurement errors on a PostScript deviceplt: make 2-D plotspltf: make function plotspnnlist: derive pNNx statistics from an annotation interval listpNNx: derive pNNx statistics from annotation filesqrs125: single-channel QRS detector designed for 125 Hz inputstepdet: single-channel step change detectortach: heart rate tachometerwabp: arterial blood pressure (ABP) pulse detector