Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using readannot Requested array exceeds the maximum possible variable size when perform QRS detection #19

Open
Qudor-Engineer opened this issue Jan 14, 2022 · 2 comments

Comments

@Qudor-Engineer
Copy link

Qudor-Engineer commented Jan 14, 2022

Hi @marianux
thank you very much for the great ECG kit, it helped me a lot during my PhD.

I tried to run QRS detection using ECGkit (latest version) in MATLAB R2021b on Ubuntu 20.04 but I got an error that says "Error using readannot Requested array exceeds the maximum possible variable size when perform QRS detection". actually, my ECG array size is 15000 samples and the file size on the disk is around 115 kB. Also, I changed the maximum array size in the MATLAB workspace preferences to the maximum (10000) and stopped the option of "Limit array size to percentage of RAM" but still the same. I wish you could help me to solve this problem. Thank you in advance

my code:

% Load the ECG signals and QRS detection files
for i = 1:112
    if i < 19

       % Load normal ECG signals
       dname='/home/qudor/Documents/PhD/PhD/Data4/Normal/Preprocessed/';
       

       % Load SCD 1 min ECG signals
    elseif i > 18 && i < 38
        dname='/home/qudor/Documents/PhD/PhD/Data4/SCD1/Preprocessed/';
        

        % Load SCD 30 min ECG signals
    elseif i > 37 && i < 57
        dname='/home/qudor/Documents/PhD/PhD/Data4/SCD30/Preprocessed/';
        

        % Load SCD 60 min ECG signals
    elseif i > 56 && i < 76
        dname='/home/qudor/Documents/PhD/PhD/Data4/SCD60/Preprocessed/';
        

        % Load SCD 90 min ECG signals
    elseif i > 75 && i < 95
        dname='/home/qudor/Documents/PhD/PhD/Data4/SCD90/Preprocessed/';
        

    else
       % Load SCD 120 min ECG signals
       dname='/home/qudor/Documents/PhD/PhD/Data4/SCD120/Preprocessed/';
       
    end
       file=[num2str(i) '.mat'];
       fname=fullfile(dname,file);
       
       fileQRS=[num2str(i) '_QRS_detection.mat'];
       fnameQRS=fullfile(dname,fileQRS);

       tmp_path = '/home/qudor/Documents/PhD/PhD/Data4/delineation/';

       
 %% QRS Detection
       
       ECGw = ECGwrapper('recording_name',fname, 'ECGtaskHandle', 'QRS_detection');
       
       ECGw.Run
       
       
       
       
 %% ECG Delineation
 
  ECGw.ECGtaskHandle = 'ECG_delineation';
 
  ECGw.ECGtaskHandle.payload = load(fnameQRS);

  ECGw.Run
 
 
 clear ECGw file fileQRS fnameQRS fname dname
end
 
fprintf('QRS detection and ECG delineation Completed! \n')

===================
and this is the output with the error:

Description of the process:
 + Recording: /home/qudor/Documents/PhD/PhD/Data4/Normal/Preprocessed/1.mat
 + Task name: QRS_detection                                                

Processing QRS detector aristotle

###############################################
# Could not execute "aristotle" QRS detector. #
###############################################

Processing QRS detector ecgpuwave

###############################################
# Could not execute "ecgpuwave" QRS detector. #
###############################################

Processing QRS detector epltdqrs1

####################################################
# epltdqrs1 failed in recording 1_1_15000 lead ecg #
####################################################

Processing QRS detector epltdqrs2
cd /tmp/;epltdqrs1 -r 1_1_15000 -s 0 -m 1: Signal 127

####################################################
# epltdqrs2 failed in recording 1_1_15000 lead ecg #
####################################################

Processing QRS detector gqrs
cd /tmp/;epltdqrs2 -r 1_1_15000 -s 0 -m 1: Signal 127
Error using ECGtask_QRS_detection/Process (line 480)
gqrs failed in recording 1_1_15000 lead ecg

Error report:
Error using readannot
Requested array exceeds the maximum possible variable size.

Error in ECGtask_QRS_detection/Process (line 448)
                                            anns_test = readannot(file_name_orig);

Error in ECGwrapper/Run (line 682)
                            payload = obj.ECGtaskHandle.Process(ECG, this_iter_ECG_start_idx, this_iter_ECG_relative_start_end_idx,
                            this_header, this_ann, [this_iter_QRS_start_idx this_iter_QRS_end_idx] );

Error in Automated_ECGkit (line 52)
       ECGw.Run

Related documentation

Error in ECGwrapper/Run (line 682)
                            payload = obj.ECGtaskHandle.Process(ECG, this_iter_ECG_start_idx, this_iter_ECG_relative_start_end_idx, this_header, this_ann, [this_iter_QRS_start_idx this_iter_QRS_end_idx] );

Error in Automated_ECGkit (line 52)
       ECGw.Run
@marianux
Copy link
Owner

marianux commented Jan 14, 2022 via email

@Qudor-Engineer
Copy link
Author

Qudor-Engineer commented Jan 15, 2022

Thanks for the fast replay.
I tried my code and data with MATLAB 2017b and I changed the maximum array size in the MATLAB workspace preferences
to the maximum (10000) and stopped the option of "Limit array size to percentage of RAM" and it is working without any issues. Hopefully, this information gives you a hint to help update the ECG kit in the future or at least be helpful for someone else using ECGkit and facing the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants