如何在库WFDB中使用XQRS方法?

时间:2018-06-30 08:38:16

标签: python methods waveform

工作示例:

import wfdb 
from wfdb import processing
sig, fields = wfdb.rdsamp('sample-data/100', channels=[0], sampto=15000)
ann_ref = wfdb.rdann('sample-data/100','atr', sampto=15000)

xqrs = processing.XQRS(sig=sig[:,0], fs=fields['fs'])
xqrs.detect()
comparitor = processing.compare_annotations(ref_sample=ann_ref.sample[1:],
                                            test_sample=xqrs.qrs_inds,
                                            window_width=int(0.1 * fields['fs']),
                                            signal=sig[:,0])

comparitor.print_summary()
comparitor.plot(title='xqrs detected qrs vs reference annotations')

我正在尝试获取ptbdb / Patient002 /的结果:

import wfdb 
from wfdb import processing

sig, fields = wfdb.rdsamp('s0015lre', pb_dir='ptbdb/patient002/', channels=[0], sampto=15000)
ann_ref = wfdb.rdann('ptbdb','atr', sampto=15000)
xqrs = processing.XQRS(sig=sig[:,0], fs=fields['fs'])
xqrs.detect()
comparitor = processing.compare_annotations(ref_sample=ann_ref.sample[1:],
                                            test_sample=xqrs.qrs_inds,
                                            window_width=int(0.1 * fields['fs']),
                                            signal=sig[:,0])

comparitor.print_summary()
comparitor.plot(title='xqrs detected qrs vs reference annotations')

要使其正常运行,我需要在rdann()中进行什么传输?

0 个答案:

没有答案