-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsumann.m
executable file
·76 lines (71 loc) · 1.73 KB
/
sumann.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
function varargout=sumann(varargin)
%
% report=sumann(recName,annName,stopTime,qrsAnnotationsOnly)
%
% Wrapper to WFDB SUMANN:
% http://www.physionet.org/physiotools/wag/sumann-1.htm
%
% Reads a WFDB annotation file and summarize its contents.
%
% Ouput Parameters:
%
% report
% String with the contaning summary of the contents, including the
% number of annotations of each type as well the duration and number of
% episodes of each rhythm and signal quality.
%
%Input Parameters:
% recName
% String specifying the WFDB record file.
%
% annName
% String specifying the reference WFDB annotation file.
%
% stopTime (Optional)
% String specifying the stop time in WFDB format (default is end of
% record).
%
% qrsAnnotationsOnly (Optional)
% 1x1 Boolean. If true, summarize QRS annotation only (default = 0).
%
%
% Written by Ikaro Silva, 2013
% Last Modified: -
% Version 1.0
% Since 0.9.0
%
% %Example (this will generate a /mitdb/100.qrs file at your directory):
%
% report=sumann('mitdb/100','atr');
%
%
%
% See also RDANN, MXM, WFDBTIME, BXB
%endOfHelp
persistent javaWfdbExec
if(isempty(javaWfdbExec))
javaWfdbExec=getWfdbClass('sumann');
end
%Set default pararamter values
inputs={'recName','annName','stopTime','qrsAnnotationsOnly'};
recName=[];
annName=[];
stopTime=[];
qrsAnnotationsOnly=0;
for n=1:nargin
if(~isempty(varargin{n}))
eval([inputs{n} '=varargin{n};'])
end
end
wfdb_argument={'-r',recName,'-a',annName};
if(~isempty(stopTime))
wfdb_argument{end+1}='-t';
wfdb_argument{end+1}=stopTime;
end
if(qrsAnnotationsOnly)
wfdb_argument{end+1}='-q';
end
report=javaWfdbExec.execToStringList(wfdb_argument);
if(nargout>0)
varargout{1}=report;
end