;Mdocutils.nodesdocument)}}( attributes}(backrefs]ids]classes]sourcehubhcompound)}}(h}(h]h]h ]h ]toctree-wrapperah]uh#h?h$hhhh%h&h'Nh(]sphinx.addnodestoctree)}}(h}(h ] includefiles]examplesanumberedK includehiddenh] titlesonlyglobcaptionNh]h]maxdepthJh> first_exampleh ]hiddenentries]Another examplehVauh#hMh$hh%h&h'Kh(]h>hBubah>hubh paragraph)}}(h}(h]h]h ]h ]h]uh#hhh$hhhh%XXThe script ``/examples/first_simple_example.m`` shows the use of the ECGkit in multimodal-cardiovascular recordings included with this kit in the ``recordings`` folder. These recordings include arterial blood pressure (ABP), plethysmographic (PPG) and electrocardiogram (ECG) signals. The following tasks will be performed in the first example:h'K h(](h8 The script }}(h% The script h>hkubhliteral)}}(h}(h]h]h ]h ]h]uh#h{h%$``/examples/first_simple_example.m``h(]h8 /examples/first_simple_example.m}}(h%h&h>h~ubah>hkubh8c shows the use of the ECGkit in multimodal-cardiovascular recordings included with this kit in the }}(h%c shows the use of the ECGkit in multimodal-cardiovascular recordings included with this kit in the h>hkubh|)}}(h}(h]h]h ]h ]h]uh#h{h%``recordings``h(]h8 recordings}}(h%h&h>hubah>hkubh8 folder. These recordings include arterial blood pressure (ABP), plethysmographic (PPG) and electrocardiogram (ECG) signals. The following tasks will be performed in the first example:}}(h% folder. These recordings include arterial blood pressure (ABP), plethysmographic (PPG) and electrocardiogram (ECG) signals. The following tasks will be performed in the first example:h>hkubeh>hubh bullet_list)}}(h}(h]h ]h ]h]bullet-h]uh#hh$hhhh%h&h'Kh(](h list_item)}}(h}(h]h]h ]h ]h]uh#hh$hhhh%8:ref:`Heartbeat/QRS detection `h'Nh(]hi)}}(h}(h]h]h ]h ]h]uh#hhh$hh%hh'Kh(]hL pending_xref)}}(h}(h]refwarnh ]h ]reftyperefrefdoch`h] refexplicith] refdomainstd reftargetqrs_automatic_detectionuh#hh$hh%hh'Kh(]hinline)}}(h}(h]h]h ]h ](xrefhߌstd-refeh]uh#hh%hh(]h8Heartbeat/QRS detection}}(h%h&h>hubah>hubah>hubah>hubah>hubh)}}(h}(h]h]h ]h ]h]uh#hh$hhhh%8:ref:`ABP/PPG pulse detection `h'Nh(]hi)}}(h}(h]h]h ]h ]h]uh#hhh$hh%hh'Kh(]h)}}(h}(h]hՈh ]h ]reftyperefhh`h] refexplicith] refdomainstdhppg_abp_pulse_detectionuh#hh$hh%hh'Kh(]h)}}(h}(h]h]h ]h ](hjstd-refeh]uh#hh%hh(]h8ABP/PPG pulse detection}}(h%h&h>jubah>j ubah>jubah>hubah>hubh)}}(h}(h]h]h ]h ]h]uh#hh$hhhh%7:ref:`ECG wave delineation `h'Nh(]hi)}}(h}(h]h]h ]h ]h]uh#hhh$hh%j4h'Kh(]h)}}(h}(h]hՈh ]h ]reftyperefhh`h] refexplicith] refdomainstdhecg_automatic_delineationuh#hh$hh%j4h'Kh(]h)}}(h}(h]h]h ]h ](hjMstd-refeh]uh#hh%j4h(]h8ECG wave delineation}}(h%h&h>jQubah>jAubah>j7ubah>j,ubah>hubh)}}(h}(h]h]h ]h ]h]uh#hh$hhhh%D:ref:`Heartbeat classification `h'Nh(]hi)}}(h}(h]h]h ]h ]h]uh#hhh$hh%jih'Kh(]h)}}(h}(h]hՈh ]h ]reftyperefhh`h] refexplicith] refdomainstdh"automatic_heartbeat_classificationuh#hh$hh%jih'Kh(]h)}}(h}(h]h]h ]h ](hjstd-refeh]uh#hh%jih(]h8Heartbeat classification}}(h%h&h>jubah>jvubah>jlubah>jaubah>hubh)}}(h}(h]h]h ]h ]h]uh#hh$hhhh%;:ref:`Report generation ` h'Nh(]hi)}}(h}(h]h]h ]h ]h]uh#hhh$hh%::ref:`Report generation `h'Kh(]h)}}(h}(h]hՈh ]h ]reftyperefhh`h] refexplicith] refdomainstdhvisual_inspection_of_the_signaluh#hh$hh%jh'Kh(]h)}}(h}(h]h]h ]h ](hjstd-refeh]uh#hh%jh(]h8Report generation}}(h%h&h>jubah>jubah>jubah>jubah>hubeh>hubhi)}}(h}(h]h]h ]h ]h]uh#hhh$hhhh%The script is prepared to perform visual inspection of the automatic algorithms, with the ``bGUICorrection`` flag, but it is disabled by default. In the following listing, you can see a typical output of the example script.h'Kh(](h8ZThe script is prepared to perform visual inspection of the automatic algorithms, with the }}(h%ZThe script is prepared to perform visual inspection of the automatic algorithms, with the h>jubh|)}}(h}(h]h]h ]h ]h]uh#h{h%``bGUICorrection``h(]h8bGUICorrection}}(h%h&h>jubah>jubh8s flag, but it is disabled by default. In the following listing, you can see a typical output of the example script.}}(h%s flag, but it is disabled by default. In the following listing, you can see a typical output of the example script.h>jubeh>hubh literal_block)}}(h}(h]languagenoneh ]h ]linenoshighlight_args}h]h] xml:spacepreserveuh#jh$hhhh%X>> first_simple_example() Description of the process: + Recording: \your_path\ecg-kit\recordings\208.hea + Task name: QRS_detection Processing QRS detector gqrs Processing QRS detector wavedet No multilead strategy used, instead using the delineation of lead MLII. Processing QRS detector wqrs ############## # Work done! # ############## Results saved in + \your_path\ecg-kit\recordings\208_my_experiment_name_QRS_detection.math'Kh(]h8X>> first_simple_example() Description of the process: + Recording: \your_path\ecg-kit\recordings\208.hea + Task name: QRS_detection Processing QRS detector gqrs Processing QRS detector wavedet No multilead strategy used, instead using the delineation of lead MLII. Processing QRS detector wqrs ############## # Work done! # ############## Results saved in + \your_path\ecg-kit\recordings\208_my_experiment_name_QRS_detection.mat}}(h%h&h>jubah>hubhi)}}(h}(h]h]h ]h ]h]uh#hhh$hhhh%The script starts with the QRS complex detection, producing a result file, which can be used later by other tasks, or to access results. Then the script follows with the pulse detection task:h'K/h(]h8The script starts with the QRS complex detection, producing a result file, which can be used later by other tasks, or to access results. Then the script follows with the pulse detection task:}}(h%jh>j ubah>hubj)}}(h}(h]jnoneh ]h ]jj}h]h]jjuh#jh$hhhh%X############## # Work done! # ############## Results saved in + \your_path\ecg-kit\recordings\208_my_experiment_name_QRS_detection.mat Description of the process: + Recording: \your_path\ecg-kit\recordings\208.hea + Task name: PPG_ABP_detector Could not find any PPG/ABP signal, check the lead description of the recording: + MLII + V1 Requirements not satisfied in \your_path\ecg-kit\recordings\208.hea for task PPG_ABP_detector. ###################### # Nothing to do here # ######################h'K3h(]h8X############## # Work done! # ############## Results saved in + \your_path\ecg-kit\recordings\208_my_experiment_name_QRS_detection.mat Description of the process: + Recording: \your_path\ecg-kit\recordings\208.hea + Task name: PPG_ABP_detector Could not find any PPG/ABP signal, check the lead description of the recording: + MLII + V1 Requirements not satisfied in \your_path\ecg-kit\recordings\208.hea for task PPG_ABP_detector. ###################### # Nothing to do here # ######################}}(h%h&h>jubah>hubhi)}}(h}(h]h]h ]h ]h]uh#hhh$hhhh%As the default recording pointed by the script is the 208 from the MIT arrhythmia database, the task exits without finding any pulsatile signal, such as ABP or PPG. After exiting, it starts with the delineation taskh'KMh(]h8As the default recording pointed by the script is the 208 from the MIT arrhythmia database, the task exits without finding any pulsatile signal, such as ABP or PPG. After exiting, it starts with the delineation task}}(h%j6h>j.ubah>hubj)}}(h}(h]jnoneh ]h ]jj}h]h]jjuh#jh$hhhh%Xf Description of the process: + Recording: \your_path\ecg-kit\recordings\208.hea + Task name: ECG_delineation Processing ECG delineator wavedet No multilead strategy used, instead using the delineation of lead MLII. ############## # Work done! # ############## Results saved in + \your_path\ecg-kit\recordings\208_my_experiment_name_ECG_delineation.math'KQh(]h8Xf Description of the process: + Recording: \your_path\ecg-kit\recordings\208.hea + Task name: ECG_delineation Processing ECG delineator wavedet No multilead strategy used, instead using the delineation of lead MLII. ############## # Work done! # ############## Results saved in + \your_path\ecg-kit\recordings\208_my_experiment_name_ECG_delineation.mat}}(h%h&h>j>ubah>hubhi)}}(h}(h]h]h ]h ]h]uh#hhh$hhhh%XThe result produced is exactly the same as the QRS detection task. This can be convenient for backing up intermediate results and reproducing experiment results. Other interesting aspect to differentiate experiments is the ``user_string`` property of the ECGwrapper object. Note that the results produced retain the user string suffix. After that, the example performs heartbeat classification and finally produces a report.h'Kch(](h8The result produced is exactly the same as the QRS detection task. This can be convenient for backing up intermediate results and reproducing experiment results. Other interesting aspect to differentiate experiments is the }}(h%The result produced is exactly the same as the QRS detection task. This can be convenient for backing up intermediate results and reproducing experiment results. Other interesting aspect to differentiate experiments is the h>jPubh|)}}(h}(h]h]h ]h ]h]uh#h{h%``user_string``h(]h8 user_string}}(h%h&h>jaubah>jPubh8 property of the ECGwrapper object. Note that the results produced retain the user string suffix. After that, the example performs heartbeat classification and finally produces a report.}}(h% property of the ECGwrapper object. Note that the results produced retain the user string suffix. After that, the example performs heartbeat classification and finally produces a report.h>jPubeh>hubj)}}(h}(h]jnoneh ]h ]jj}h]h]jjuh#jh$hhhh%XDescription of the process: + Recording: \your_path\ecg-kit\recordings\208.hea + Task name: ECG_heartbeat_classifier + Using gqrs_MLII detections. 15-Apr-2015 Configuration ------------- + Recording: (AHA) + Mode: auto (12 clusters, 1 iterations, 75% cluster-presence) ############## # Work done! # ############## Results saved in + \your_path\ecg-kit\recordings\208_my_experiment_name_ECG_heartbeat_classifier.math'Khh(]h8XDescription of the process: + Recording: \your_path\ecg-kit\recordings\208.hea + Task name: ECG_heartbeat_classifier + Using gqrs_MLII detections. 15-Apr-2015 Configuration ------------- + Recording: (AHA) + Mode: auto (12 clusters, 1 iterations, 75% cluster-presence) ############## # Work done! # ############## Results saved in + \your_path\ecg-kit\recordings\208_my_experiment_name_ECG_heartbeat_classifier.mat}}(h%h&h>jwubah>hubhi)}}(h}(h]h]h ]h ]h]uh#hhh$hhhh%`As a result, the report found in ``\your_path\ecg-kit\recordings\208_full.pdf`` looks like this:h'Kh(](h8!As a result, the report found in }}(h%!As a result, the report found in h>jubh|)}}(h}(h]h]h ]h ]h]uh#h{h%.``\your_path\ecg-kit\recordings\208_full.pdf``h(]h8*\your_path\ecg-kit\recordings\208_full.pdf}}(h%h&h>jubah>jubh8 looks like this:}}(h% looks like this:h>jubeh>hubhimage)}}(h}(h]h ]h ]uri208_full_03.png candidates}*jsh]h]uh#jh$hhhh%.. image:: 208_full_03.png h'Kh(]h>hubhi)}}(h}(h]h]h ]h ]h]uh#hhh$hhhh%jubah>hubj)}}(h}(h]h ]h ]uri208_full_14.pngj}jjsh]h]uh#jh$hhhh%.. image:: 208_full_14.png h'Kh(]h>hubhi)}}(h}(h]h]h ]h ]h]uh#hhh$hhhh%X'A more detailed view can be found in the last part of the report, you will find the results of the QRS detection, delineation and heartbeat classification. In the top right of the chart you will find the references for interpreting the results displayed. For example, QRS detection legend indicates a colour-code for the dotted lines with triangles in the extremes, placed around the QRS complexes. As recording 208 does not presents much controversy respect QRS detection, all detections are clustered around each heartbeat, but the legend indicates:h'Kh(]h8X'A more detailed view can be found in the last part of the report, you will find the results of the QRS detection, delineation and heartbeat classification. In the top right of the chart you will find the references for interpreting the results displayed. For example, QRS detection legend indicates a colour-code for the dotted lines with triangles in the extremes, placed around the QRS complexes. As recording 208 does not presents much controversy respect QRS detection, all detections are clustered around each heartbeat, but the legend indicates:}}(h%jh>jubah>hubh block_quote)}}(h}(h]h]h ]h ]h]uh#jh$Nhhh%h&h'Nh(]h)}}(h}(h]h ]h ]h]hhh]uh#hh%h&h(](h)}}(h}(h]h]h ]h ]h]uh#hh%**global*, the wavedet multilead detection.h(]hi)}}(h}(h]h]h ]h ]h]uh#hhh$hh%jh'Kh(](hemphasis)}}(h}(h]h]h ]h ]h]uh#jh%*global*h(]h8global}}(h%h&h>jubah>jubh8", the wavedet multilead detection.}}(h%", the wavedet multilead detection.h>jubeh>jubah>jubh)}}(h}(h]h]h ]h ]h]uh#hh%@*hb_classifier*, the detection used by the heartbeat classifier.h(]hi)}}(h}(h]h]h ]h ]h]uh#hhh$hh%j;h'Kh(](j)}}(h}(h]h]h ]h ]h]uh#jh%*hb_classifier*h(]h8 hb_classifier}}(h%h&h>jHubah>j>ubh81, the detection used by the heartbeat classifier.}}(h%1, the detection used by the heartbeat classifier.h>j>ubeh>j3ubah>jubh)}}(h}(h]h]h ]h ]h]uh#hh%E*included*, the gold-standard, visually-audited Physionet detections.h(]hi)}}(h}(h]h]h ]h ]h]uh#hhh$hh%jfh'Kh(](j)}}(h}(h]h]h ]h ]h]uh#jh% *included*h(]h8included}}(h%h&h>jsubah>jiubh8;, the gold-standard, visually-audited Physionet detections.}}(h%;, the gold-standard, visually-audited Physionet detections.h>jiubeh>j^ubah>jubh)}}(h}(h]h]h ]h ]h]uh#hh%>*gqrs_MLII*, the detections of *gqrs* algorithm in lead MLII. h(]hi)}}(h}(h]h]h ]h ]h]uh#hhh$hh%=*gqrs_MLII*, the detections of *gqrs* algorithm in lead MLII.h'Kh(](j)}}(h}(h]h]h ]h ]h]uh#jh% *gqrs_MLII*h(]h8 gqrs_MLII}}(h%h&h>jubah>jubh8, the detections of }}(h%, the detections of h>jubj)}}(h}(h]h]h ]h ]h]uh#jh%*gqrs*h(]h8gqrs}}(h%h&h>jubah>jubh8 algorithm in lead MLII.}}(h% algorithm in lead MLII.h>jubeh>jubah>jubeh>jubah>hubhi)}}(h}(h]h]h ]h ]h]uh#hhh$hhhh%XAbove the legend of QRS detections, it is the delineation legend, with a colour-code for identifying each wave. For example in pink you can see several QRS complexes correctly segmented, but three of them are wrong. If you pay attention to the extreme widened ventricular beats, they are very underestimated. T-waves in orange, seems quite correctly measured, and P-waves as you can see are not correctly measured at all.h'Kh(]h8XAbove the legend of QRS detections, it is the delineation legend, with a colour-code for identifying each wave. For example in pink you can see several QRS complexes correctly segmented, but three of them are wrong. If you pay attention to the extreme widened ventricular beats, they are very underestimated. T-waves in orange, seems quite correctly measured, and P-waves as you can see are not correctly measured at all.}}(h%jh>jubah>hubhi)}}(h}(h]h]h ]h ]h]uh#hhh$hhhh%You can experiment with the ``/examples/second_simple_example.m`` to see how to extend this experiment to a multiprocessor environment.h'Kh(](h8You can experiment with the }}(h%You can experiment with the h>jubh|)}}(h}(h]h]h ]h ]h]uh#h{h%%``/examples/second_simple_example.m``h(]h8!/examples/second_simple_example.m}}(h%h&h>jubah>jubh8F to see how to extend this experiment to a multiprocessor environment.}}(h%F to see how to extend this experiment to a multiprocessor environment.h>jubeh>hubeh>hubsautofootnote_refs]current_sourceNrefnames}id_startKtransform_messages]settingsdocutils.frontendValues)}}( pep_base_url https://www.python.org/dev/peps/embed_stylesheetexpose_internalsNinput_encoding_error_handlerstrictdebugNstrip_commentsN_disable_configNpep_referencesN source_linkNfootnote_backlinksKrfc_referencesNsyntax_highlightlongstrict_visitorNfile_insertion_enabled _config_files]input_encoding utf-8-sig language_codeendump_internalsN_sourcehwarning_streamNoutput_encoding_error_handlerj strip_classesN datestampN raw_enabledK generatorNrecord_dependenciesN sectnum_xformKgettext_compactcloak_email_addresses smart_quotes rfc_base_urlhttps://tools.ietf.org/html/ docinfo_xformKerror_encoding_error_handlerbackslashreplacepep_file_url_templatepep-%04derror_encodingcp850configN halt_levelK dump_settingsNdump_transformsN _destinationNauto_id_prefixid toc_backlinksentrysectsubtitle_xform id_prefixh&output_encodingutf-8 tab_widthKtrim_footnote_reference_spaceexit_status_levelKstrip_elements_with_classesN source_urlNh*N tracebackdump_pseudo_xmlN report_levelKdoctitle_xformenvNub footnote_refs}substitution_names} nametypes}hNssymbol_footnote_refs] current_lineNindirect_targets]hhsubstitution_defs}nameids}hhssymbol_footnotes]h#hparse_messages]refids}reporterNh%h&symbol_footnote_startK transformerN footnotes] citation_refs} citations] autofootnotes]autofootnote_startK decorationNh(]haub.