Number of Beats - ECG- MIT BIH database

32 views
Skip to first unread message

Preethi Krishnan

unread,
Feb 19, 2019, 5:50:25 PM2/19/19
to ecg-kit users

Hello Everyone,

 

I am using ECG kit software for ECG delineation for  MIT BIH  Arrhythmia database. When I run the ECG kit software the number of beats I obtain are less than what is in Physionet database.


I have attached the files. Please let me know if I am making any mistakes running the software.

 

Database - https://www.physionet.org/cgi-bin/atm/ATM

 

File - Patient 222 - physionet - light wave - 2634 annotated beats

 

ECG kit - wave det MLII - 2474 beats


Thank you,

Preethi

Capture_Physionet_lightwave_beats.PNG
222_my_experiment_name_ECG_delineation.mat

Mariano Llamedo Soria

unread,
Feb 21, 2019, 11:48:40 AM2/21/19
to ecg-kit users
Hi Preethi, thanks for trying the kit. Please paste or add some part of the code in order to see exactly what you are doing. I guess that you are not using the included heartbeat detections in order to perform delineation. In that case, keep in mind that the QRS detection is performed by wavedet algorithm automatically and could lead to erroneously detected or missed heartbeats. That could explain the disagreement. 
In case you are not interested in performing automatic heartbeat detection, you can use the annotations provided with the recording. Check the examples to see how to do that. 

Let me know if you suceed with this.

Best,
M.


--
You received this message because you are subscribed to the Google Groups "ecg-kit users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ecg-kit-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ecg-kit-users/433e8e9a-e347-4b71-92c4-c7b421ce4b7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Preethi Krishnan

unread,
Feb 21, 2019, 9:00:01 PM2/21/19
to ecg-kit users
Thanks for the response. As per your suggestion I am just running QRS detection and ECG delineation using first_sample_example. I still get 2474 beats for MLII lead compared to 2634 in physionet annotation file. I have pasted the code below :

Thank you,
Preethi

%% Very simple example of how to use the ecg-kit
% This script exemplifies the use of the ecg-kit in a very short multimodal
% cardiovascular recording which includes arterial blood pressure (ABP),
% plethysmographic (PPG) and electrocardiogram signals. The following tasks
% will be performed in this example:  
% * Heartbeat/QRS detection
% * ABP/PPG pulse detection
% * ECG wave delineation
% * Heartbeat classification
% * Report generation
% Each automatic step is followed by a manual verification step in order to
% verify the algorithm's results.
% You can watch a typical run of this script online
%  
% See also ECGwrapper, ECGtask, UnInstallECGkit, ECGkit_examples
% *Author*: Mariano Llamedo Soria
% <matlab:web('mailto:llam...@electron.frba.utn.edu.ar','-browser') (email)> 
% *Version*: 0.1 beta
% *Birthdate*: 11/13/2014
% *Last update*: 15/4/2015
% *Copyright* 2008-2015
function first_simple_example()

    root_path = fileparts(mfilename('fullpath'));
    % get the parent or ecg-kit root folder.
    root_path = fileparts(root_path);
    % default folder to look at
    examples_path = [root_path filesep 'recordings' filesep ];

    % the filename of the recording
    example_filename = '222.hea';
%     example_filename = '800.hea';
%     example_filename = 'example_recording.mat';

    % user-defined string to customize the experiment
    my_user = 'my_experiment_name';
    % Set to true, if you want to test the GUI for auditing and correcting
    % the automatic algorithm results.
    bGUICorrection = false;
    
    
%     this is an ECGwrapper object, and is the interface to get samples
    % from the recordings to the processing algorithms.
    ECGw = ECGwrapper('recording_name', [examples_path example_filename]);
    % in this example we are not interested in caching results, since the
    % recording is very short, so we will re-process every call.
    ECGw.cacheResults = true; %%%%%Preethi edit - made it true
    % add a user-defined prefix to the result filenames
    ECGw.user_string = my_user;
    
%     % QRS detection in ALL the signals present in the recording, with ALL
%     % the QRS detection algorithms available.
%     ECGw.ECGtaskHandle = 'QRS_detection';
%     ECGw.Run    
    
    % QRS detection, but only in those signals that seems to be ECG. That
    % mean, that the description of the signal give some clue about ECG. If
    % not sure, process all signals as ECG.
    ECGw.ECGtaskHandle = 'QRS_detection';
    ECGw.ECGtaskHandle.only_ECG_leads = true;
    % just restrict the run to the three algorithms
    ECGw.ECGtaskHandle.detectors =  { 'wavedet', 'gqrs', 'wqrs'};
    ECGw.Run    
    
%     % Pulse detection in pulsatile signals
%     ECGw.ECGtaskHandle = 'PPG_ABP_detector';
%     % only in pulsatile signals. This is donde as before, based on the
%     % description of the signal, if unsure, process all signals.
%     ECGw.ECGtaskHandle.lead_config = 'PPG-ABP-only';
%     ECGw.Run
    if( bGUICorrection )
        % this step if for correcting the automatic detections performed before
        ECGw.ECGtaskHandle = 'QRS_corrector';
        % with the following two lines, you can use as starting point the
        % manual corrected detections (if available) or the automatic
        % detections.
        cached_filenames = ECGw.GetCahchedFileName({'QRS_corrector' 'QRS_detection'});
        ECGw.ECGtaskHandle.payload = load(cached_filenames{1});
        ECGw.Run
    
        % same as before, but for the pulsatile signals.
        ECGw.ECGtaskHandle = 'PPG_ABP_corrector';
        cached_filenames = ECGw.GetCahchedFileName({'PPG_ABP_corrector' 'PPG_ABP_detector'});
        ECGw.ECGtaskHandle.payload = load(cached_filenames{1});    
    end
    
%     here we perform ECG delineation based on the previous QRS detections
%     (the corrected ones if available) with ALL the algorithms present in
%     the toolbox (wavedet only at the moment of writing this)
    ECGw.ECGtaskHandle = 'ECG_delineation';
    cached_filenames = ECGw.GetCahchedFileName({'QRS_corrector' 'QRS_detection'});
    ECGw.ECGtaskHandle.payload = load(cached_filenames{1});
    ECGw.Run    
%     
%     if( bGUICorrection )
%         % in case you would like to correct the delineation marks, you can do
%         % it with this task.
%         ECGw.ECGtaskHandle = 'ECG_delineation_corrector';
%         cached_filenames = ECGw.GetCahchedFileName({'ECG_delineation_corrector' 'ECG_delineation'});
%         ECGw.ECGtaskHandle.payload = load(cached_filenames{1});
%         ECGw.Run
%     end
%     
%     % finally you can classify the heartbeats according to the AAMI
%     % classes, also based in the previous QRS detections (again, the
%     % corrected ones if available) 
%     ECGw.ECGtaskHandle = 'ECG_heartbeat_classifier';
%     ECGw.ECGtaskHandle.mode = 'assisted';
%     cached_filenames = ECGw.GetCahchedFileName({'QRS_corrector' 'QRS_detection'});
%     ECGw.ECGtaskHandle.payload = load(cached_filenames{1});
%     ECGw.Run    

    % at the end, generate a report pretty-printed report with the results
%     reportECG(ECGw, 'LowDetail', 'full')
    
Reply all
Reply to author
Forward
0 new messages