-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcalc_plot_septum.m
33 lines (26 loc) · 1.17 KB
/
calc_plot_septum.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function [geh, med_intervals, septumbeat, septumvcg]...
= calc_plot_septum(median_vcg, beatsig_vcg, aps, hObject, eventdata, handles)
[~, medianQRS] = max(median_vcg.VM);
% annotate original median beat
medRR = median(diff(handles.beats.QRS));
aps.STend = round(aps.STend * medRR/100);
medianbeat = Beats(median_vcg, medianQRS, aps);
% Calculate VCG_Calc - note VCG_Calc does its own cropping
geh = VCG_Calc(median_vcg, medianbeat, aps);
% plot septum annotations
qrspct = aps.septumwindow;
window = round(medianbeat.QRSdur() * qrspct/100);
septumvcg = median_vcg.crop(1, medianbeat.Q+window);
% check for a z-peak to display
zpeak = geh.septum_t_end * median_vcg.hz/1000 + medianbeat.Q-1;
tspeedmax = geh.septum_t_speed_max * median_vcg.hz/1000 + medianbeat.Q-1;
if isempty(zpeak) || isnan(zpeak)
septumbeat = Beats(NaN, NaN, NaN, NaN, NaN);
else
septumbeat = Beats(medianbeat.Q, NaN, NaN, NaN, zpeak);
beatsig_septum = beatsig_vcg.crop2d(1, medianbeat.Q+window);
display_medianbeats(septumvcg, beatsig_septum, septumbeat, tspeedmax, hObject, eventdata, handles);
end
% Calculate median beat intervals
med_intervals = median_intervals(median_vcg, medianbeat, handles.hr);
end