a b/apnea-ecg-database-1.0.0/annotations.shtml
1
<!--#set var="TITLE" value="Apnea-ECG Database Annotations"-->
2
<!--#include virtual="/head.shtml"-->
3
4
5
<p>
6
Two sets of annotations are supplied with the data for the
7
<a href="/challenge/2000/">Computers in Cardiology Challenge
8
2000</a>.  These can be identified by the file name suffixes <tt>.apn</tt>
9
and <tt>.qrs</tt>.
10
11
<p>
12
The <tt>.apn</tt> files contain apnea annotations.  These are currently
13
available for the 35 records in the learning set only; those for the test set
14
will be posted here after the conclusion of the Challenge in September.  (To
15
view these annotations, use <a
16
href="/physiotools/wag/rdann-1.htm"><tt>rdann</tt></a> to convert the binary
17
annotation files into text.  If you have not used <tt>rdann</tt> previously,
18
see the detailed instructions <a href="#rdann-notes">below.</a>) These
19
annotations have been prepared on the basis of expert visual review of
20
simultaneously recorded respiration and oxygen saturation signals.  These
21
additional signals can be studied for 8 records (a01er - a04er, b01er, and
22
c01er - c03er; these contain the same ECG data as a01 - a04, b01, and c01 -
23
c03, respectively).
24
25
<p>
26
When these files were first posted here, the following (incorrect) description
27
of the <tt>.apn</tt> annotation files was also posted:
28
29
<blockquote>
30
In these files, an "A" annotation indicates that apnea occurs during the
31
<em>following</em> one-minute interval, and an "N" annotation indicates that
32
there is no apnea during the following one-minute interval.
33
</blockquote>
34
35
<p>
36
Following is a corrected description:
37
38
<blockquote>
39
In each of these files, the first annotation is placed at 0 seconds and is
40
associated with the following one-minute interval (i.e., 0-59.99 seconds
41
elapsed time from the beginning of the record), the second annotation is placed
42
at 60 seconds and is associated with the next one-minute interval (60-119.99
43
seconds), etc.  Each "A" annotation indicates that apnea was in progress <em>at
44
the beginning of the associated minute</em>; each "N" annotation indicates that
45
apnea was not in progress at the beginning of the associated minute.  The
46
diagram below may help to clarify this:
47
48
<pre>
49
|       |       |       |       |       |       |       |       |
50
        ****************              ********     ********
51
N       A       A       N       N       A       N       A       N
52
</pre>
53
54
In this diagram, elapsed time is represented by distance from the left edge.
55
The '*'s mark apneic periods, the '|'s mark the times of the <tt>.apn</tt>
56
annotations (0, 60, 120, ... seconds), and the "N"s and "A"s are the "no apnea"
57
and "apnea" annotations.
58
</blockquote>
59
60
<p>
61
The <tt>.qrs</tt> files were created using <a
62
href="/physiotools/wag/sqrs-1.htm"><tt>sqrs125</tt></a>, initially with its
63
default threshold (250).  In these files, all detected beats (including any
64
abnormal beats that were detected) are marked with "N" annotations, and
65
QRS-like artifacts are marked with "|" annotations.  Based on visual review of
66
the heart rate time series (using <a
67
href="/physiotools/wag/hrfft-1.htm"><tt>hrplot</tt></a>), and review of
68
selected portions of the original ECGs and annotations (using <a
69
href="/physiotools/wag/wave-1.htm">WAVE</a>), <tt>sqrs125</tt> was run again
70
using its <tt>-m</tt> option to select lower thresholds on some recordings (in
71
some cases, more than once) to obtain better detection of low-amplitude QRS
72
complexes.  In no case were the annotations hand-edited.  Only small numbers of
73
annotations were inspected in each recording to determine if the threshold had
74
been set appropriately.  If you wish to experiment further with
75
<tt>sqrs125</tt> or with your own QRS detector, it may be helpful to know
76
exactly how the <tt>.qrs</tt> files provided here were made, so here are the
77
commands that are needed to do so:
78
79
<pre>
80
sqrs125 -r a01
81
sqrs125 -r a02 -m 125
82
sqrs125 -r a03
83
sqrs125 -r a04
84
sqrs125 -r a05
85
sqrs125 -r a06 -m 125
86
sqrs125 -r a07
87
sqrs125 -r a08
88
sqrs125 -r a09
89
sqrs125 -r a10
90
sqrs125 -r a11
91
sqrs125 -r a12 -m 125
92
sqrs125 -r a13
93
sqrs125 -r a14
94
sqrs125 -r a15
95
sqrs125 -r a16
96
sqrs125 -r a17 -m 100
97
sqrs125 -r a18
98
sqrs125 -r a19
99
sqrs125 -r a20 -m 125
100
sqrs125 -r b01
101
sqrs125 -r b02 -m 125
102
sqrs125 -r b03 -m 125
103
sqrs125 -r b04 -m 75
104
sqrs125 -r b05 -m 125
105
sqrs125 -r b06
106
sqrs125 -r b07
107
sqrs125 -r b08
108
sqrs125 -r b09
109
sqrs125 -r b10
110
sqrs125 -r c01 -m 125
111
sqrs125 -r c02
112
sqrs125 -r c03
113
sqrs125 -r c04 -m 125
114
sqrs125 -r c05 -m 125
115
sqrs125 -r c06 -m 125
116
sqrs125 -r c07 -m 100
117
sqrs125 -r c08 -m 100
118
sqrs125 -r c09
119
sqrs125 -r c10
120
sqrs125 -r x01
121
sqrs125 -r x02
122
sqrs125 -r x03
123
sqrs125 -r x04
124
sqrs125 -r x05
125
sqrs125 -r x06
126
sqrs125 -r x07
127
sqrs125 -r x08
128
sqrs125 -r x09
129
sqrs125 -r x10
130
sqrs125 -r x11
131
sqrs125 -r x12
132
sqrs125 -r x13
133
sqrs125 -r x14 -m 125
134
sqrs125 -r x15 -m 125
135
sqrs125 -r x16
136
sqrs125 -r x17 -m 50
137
sqrs125 -r x18
138
sqrs125 -r x19
139
sqrs125 -r x20
140
sqrs125 -r x21
141
sqrs125 -r x22
142
sqrs125 -r x23
143
sqrs125 -r x24
144
sqrs125 -r x25
145
sqrs125 -r x26
146
sqrs125 -r x27
147
sqrs125 -r x28
148
sqrs125 -r x29 -m 125
149
sqrs125 -r x30
150
sqrs125 -r x31
151
sqrs125 -r x32
152
sqrs125 -r x33 -m 125
153
sqrs125 -r x34 -m 125
154
sqrs125 -r x35
155
</pre>
156
157
<a name="rdann-notes"><h2>How to use <tt>rdann</tt></h2></a>
158
159
<p>
160
<strong>Install <tt>rdann</tt>:</strong>
161
162
<p>
163
If you haven't already downloaded and installed <tt>rdann</tt>, do so now.
164
Search for <tt>rdann</tt> (type <tt>rdann</tt> into the text box above
165
the <em>Search</em> button in the left margin of this page, then click
166
on <em>Search</em>), and you will find the C-language source as well
167
as a UNIX-style manual page that describes <tt>rdann</tt>'s options
168
in more detail than below.  All versions of <tt>rdann</tt> are compiled from
169
the same source, so you can create a version for your operating system,
170
provided that you have a C compiler.  If you do this, you will also need to
171
download and compile the sources for the
172
<a href="/physiotools/wfdb.shtml">WFDB library</a> used by <tt>rdann</tt>.
173
<a href="/physiotools/binaries">Binaries</a> (executable versions of the
174
program) for several popular operating systems can also be downloaded.  Note
175
that <tt>rdann</tt> is a text-mode application;  users of MS-Windows can run
176
the MS-DOS version of <tt>rdann</tt> in a DOS window.
177
178
<p>
179
<strong>Locate the files you need:</strong>
180
181
<p>
182
Each of the data files has a <em>record name</em> (the first part of the
183
file name, before the '.') and a suffix (the second part of the file name,
184
following the '.').  For example, the file <tt>a19.apn</tt> has the record
185
name <tt>a19</tt> and the suffix <tt>apn</tt>.
186
187
<p>
188
Files with <tt>qrs</tt> or <tt>apn</tt> suffixes are binary annotation files.
189
For these files, the suffix is the <em>annotator name</em>.  Files with the
190
suffix <tt>hea</tt> are (text) header files containing information about the
191
format of the related files, and those with the suffix <tt>dat</tt> are binary
192
signal files (containing digitized samples of the ECG and other signals).
193
194
<p>
195
In order to read an annotation file successfully, you will need to download
196
both the annotation file itself and the associated header file.  For example,
197
to read <tt>a19.apn</tt>, download <tt>a19.apn</tt> and <tt>a19.hea</tt>.
198
(The Linux version of <tt>rdann</tt> can act as an HTTP client and can read the
199
files directly from the PhysioNet server without the need to store them
200
locally.  If you have compiled your own version of the WFDB library with
201
<a href="/physiotools/wpg/wpg_43.htm">NETFILES</a> support, your version
202
of <tt>rdann</tt> will also have this capability.)
203
204
<p>
205
<strong>Use <tt>rdann</tt> to convert binary annotations to text:</strong>
206
207
<p>
208
Once you know the <em>record name</em> and the <em>annotator name</em>, you can
209
use <tt>rdann</tt> to read the file.  For example, to read <tt>a19.apn</tt>,
210
use the command
211
212
<pre>
213
     rdann -r a19 -a apn -f 0
214
</pre>
215
216
<p>
217
This command will produce output on the screen that begins:
218
219
<pre>
220
    0:00.000        0     N    0    0    0
221
    1:00.000     6000     A    0    0    0
222
    2:00.000    12000     A    0    0    0
223
    3:00.000    18000     A    0    0    0
224
    4:00.000    24000     A    0    0    0
225
    5:00.000    30000     A    0    0    0
226
    6:00.000    36000     A    0    0    0
227
    7:00.000    42000     N    0    0    0
228
    8:00.000    48000     N    0    0    0
229
    9:00.000    54000     A    0    0    0
230
   10:00.000    60000     A    0    0    0
231
</pre>
232
233
(The '-f 0' option was not required by the version of rdann that was
234
available when this page was written.  If omitted, the first annotation,
235
at 0:00.000, will not appear in the output.)
236
237
<p>
238
To capture the output of <tt>rdann</tt> in a file, redirect it using a command
239
such as:
240
241
<pre>
242
     rdann -r a19 -a apn -f 0 &gt;<font color=blue><em>textfile</em></font>
243
</pre>
244
245
In this command, replace <font color=blue><tt><em>textfile</em></tt></font>
246
with any desired file name.  This method works under MS-DOS/Windows
247
as well as under all versions of UNIX.
248
249
<p>
250
Each line of <tt>rdann</tt>'s output corresponds to one annotation.  The first
251
two columns indicate the elapsed time (i.e., the interval) from the beginning
252
of the record to the sample marked by the annotation. (Column 1 gives this in
253
hours, minutes, and seconds, and column 2 gives the same information in sample
254
intervals.  In these records, one sample interval equals 10 milliseconds.)  The
255
third column contains a mnemonic code for the annotation type.  As noted above,
256
in the <tt>apn</tt> files, these codes are <tt>A</tt> for "apnea" and
257
<tt>N</tt> for "no apnea".  In the <tt>qrs</tt> files, the codes are <tt>N</tt>
258
for a QRS complex and <tt>|</tt> for a QRS-like artifact.  In these annotation
259
files, the remaining columns can be ignored.
260
261
<p>
262
The sample output shown above can therefore be interpreted thus: during the
263
first minute (beginning at 0:00.000, or sample number 0) there is no apnea
264
(<tt>N</tt>); during each of the next several one-minute periods (beginning at
265
1:00.000, 2:00.000, 3:00.000, ...), there is apnea (<tt>A</tt>).
266
267
<!--#include virtual="/footer.shtml"-->
268
</body>
269
</html>