-
Notifications
You must be signed in to change notification settings - Fork 9
/
NormalVals.m
128 lines (95 loc) · 3.9 KB
/
NormalVals.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% BRAVEHEART - Open source software for electrocardiographic and vectorcardiographic analysis
% NormalVals.m -- Class for storing normal values for select parameters
% Copyright 2016-2025 Hans F. Stabenau and Jonathan W. Waks
%
% Source code/executables: https://github.com/BIVectors/BRAVEHEART
% Contact: [email protected]
%
% BRAVEHEART is free software: you can redistribute it and/or modify it under the terms of the GNU
% General Public License as published by the Free Software Foundation, either version 3 of the License,
% or (at your option) any later version.
%
% BRAVEHEART is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
% without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
% See the GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License along with this program.
% If not, see <https://www.gnu.org/licenses/>.
%
% This software is for research purposes only and is not intended to diagnose or treat any disease.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
classdef NormalVals
properties (SetAccess=immutable)
% These properties are used to obtain the normal values
age
male
bmi
white
hr
% Properties here are pairs of values [LLN ULN] based on age, gender, bmi, race, and HR
svg_area_mag
svg_area_az
svg_area_el
sai_vm
sai_qrst
svg_x
svg_y
svg_z
% q_area_mag
% q_area_az
% q_area_el
% t_area_mag
% t_area_az
% t_area_el
%
qrst_angle_area
qrst_angle_peak
% vcg_length_qrst
% vcg_length_qrs
% vcg_length_t
%
end
methods
function obj = NormalVals(varargin)
if nargin ~= 5 && nargin ~= 0; error(['Expected 5 arguments to NormalVals constructor: Age (number), ...' ...
'Male (1 or 0), White race (1 or 0), BMI (number), and HR (number). ...' ...
'If no input arguments will default to means from https://onlinelibrary.wiley.com/doi/10.1111/jce.16062']); end
if nargin == 0
return;
else
obj.age = varargin{1};
obj.male = varargin{2};
obj.white = varargin{3};
obj.bmi = varargin{4};
obj.hr = varargin{5};
% Deal with missing values and assign defaults
if isempty(obj.age)
obj.age = 47.9;
end
if isempty(obj.male)
obj.male = 0.38;
end
if isempty(obj.bmi)
obj.bmi = 28.4;
end
if isempty(obj.hr)
obj.hr = 60;
end
if isempty(obj.white)
obj.white = 0.56;
end
end
% Get the age/gender/GMI/race/HR normal ranges and store in 'nvals'
nvals = normal_ranges(obj.age, obj.male, obj.bmi, obj.hr, obj.white);
fn = fieldnames(NormalVals());
for i = 6:length(fn) % Skip the first 5 properties which are NOT normal value ranges
obj.(fn{i}) = [nvals.low.(fn{i}) nvals.high.(fn{i})];
end
end
end
methods(Static)
function l = length(); a = NormalVals(); l = length(properties(a)); end
function labels = labels(); obj = NormalVals(); labels = properties(obj); end
end
end