ECG Database Applications Guide
Table of Contents
epic - ANSI/AAMI-standard episode-by-episode annotation comparator
epic
-r record -a reference-annotator test-annotator [ options ... ]
This
program implements the VF, AF, and ST episode-by-episode comparison algorithms
specified by the current American National Standard for ambulatory ECG
analyzers (ANSI/AAMI EC38-1994). epic is the reference implementation of
these algorithms, and must be used to obtain the episode-by-episode performance
statistics cited in EC38 in order to be in compliance with the standard.
Input to this program consists of two annotation files associated with
the same record. One of these is designated the reference annotation file,
the other the test annotation file.
Options include:
- -A file
- Append atrial
fibrillation detection reports to the specified file.
- -f time
- Begin the
comparison at the specified time (default: 5 minutes after the beginning
of the record).
- -h
- Print a usage summary.
- -i time
- Ignore episodes shorter
than time (default: 0 seconds).
- -l
- Write reports in line format (default:
matrix format).
- -L
- Same as -l.
- -S file1 file2
- Append ischemic ST episode detection
reports to file1, and ST deviation measurements to file2.
- -S0 file1 file2
- As for -S, but report on signal 0 only.
- -S1 file1 file2
- As for -S, but report
on signal 1 only.
- -t time
- Stop the comparison at the specified time (default:
the end of the record if it is defined, the end of the reference annotation
file otherwise; if time is 0, the comparison ends when the end of either
annotation file is reached).
- -V
- Append ventricular flutter and fibrillation
detection reports to the specified file.
The episode and duration statistics
gathered by epic are based on tallies of overlapping episodes in the reference
and test annotation files. Duration statistics give weight to each episode
or detection in proportion to its duration. Episode statistics give equal
weight to each episode or detection, irrespective of length; each test-annotated
episode that meets the criteria for overlap (see below) with a reference-annotated
episode is counted as a true positive. Episodes are defined as follows
(see <ecg/ecgcodes.h> for definitions of annotation types):
- Atrial fibrillation
episodes
- begin with a RHYTHM annotation, with the aux field containing
the text `(AFIB', and end with any other RHYTHM annotation (or at the end
of the record). Reference-marked episodes of atrial flutter (begun by RHYTHM
annotations with the text `(AFL') are excluded from AF comparisons (i.e.,
the test annotator is neither penalized nor rewarded for its treatment
of atrial flutter in this context). Any amount of overlap is sufficient
to qualify a test episode as a true positive.
- Ventricular fibrillation
or flutter episodes
- begin with a VFON annotation, and end with a VFOFF
annotation (or at the end of the record). RHYTHM annotations are ignored
in this context by epic. Any amount of overlap is sufficient to qualify
a test episode as a true positive.
- Ischemic ST episodes
- begin with a STCH
annotation, with the aux field containing the text `(STns', and end with
another STCH annotation, with the text `STns)' (or at the end of the record).
Between these annotations, the extremum (the time at which the absolute
value of the ST deviation is greatest) is marked with another STCH annotation,
with the text `ASTnsm'; this annotation may be omitted in the test annotation
file. In these annotations, n is `0' or `1', and denotes the affected signal;
s is `+' for episodes of ST elevation, or `-' for episodes of ST depression;
and m is the ST deviation in microvolts, relative to a reference level
established from the first 30 seconds of the record. The values of s and
m are not significant for the episode comparison made by epic. When using
the -S0 or -S1 options, n must be 0 or 1 respectively; other STCH annotations
are ignored. When using the -S option, the value of n is ignored: each
`(STns' annotation increments a counter, and each `STns)' annotation decrements
the counter; in this context, ST episodes begin when the counter becomes
positive and end when the counter reaches zero (or at the end of the record).
To qualify a test episode as a true positive for purposes of determining
ST episode sensitivity, it must overlap at least 50% of the reference
episode, or the overlap must include the reference-marked extremum. To
qualify a test episode as a true positive for purposes of determining
ST episode positive predictivity, the reference episode must overlap at
least 50% of the test episode, or the overlap must include the test-marked
extremum, if present.
The second file generated when using the `-S', `-S0', or
`-S1' options contains comparisons of ST deviation measurements wherever
such measurements are available in the reference annotation files. In
the existing databases, these appear only at extrema within each annotated
ischemic (or non-ischemic) ST episode, as described above. For purposes
of comparison of ST deviation measurements, test ST measurements for each
signal are read from the aux field of beat annotations, which should contain
text of the format `m n' (where m and n are the measured ST deviations for
signals 0 and 1 respectively). If these measurements are missing from
any test beat annotation, epic assumes that they have not changed since
they last appeared. epic ignores `AST...' annotations in the test annotation
file when making this comparison. In the output file, any test measurements
that deviate from the reference measurements by more than 100 microvolts
are tagged with an asterisk (`*'). plotstm(1)
can produce a scatter plot
of these data using this file as input.
At least one of the options `-A',
`-S', `-S0', `-S1', and `-V' must be used. If `-' is given as a file argument, reports
are written on the standard output. The output generated by selecting
-l or -L includes column headings only if a file other than `-' is specified,
and only if the specified file does not already exist. In this way, epic
can be used repeatedly to build up line-format tables for multiple records,
for further processing by sumstats(1)
.
The shell variable DB should be
set and exported (see setdb(1)
).
- non-standard comparison selected
- The -f, -i, and -t options modify the comparison algorithms used by epic
in ways not permitted by EC-38. These options are provided for the use
of developers, who may find them useful for obtaining a more detailed
understanding of algorithm errors.
Since epic performs multiple passes
over its input files, it cannot be used at the end of a pipe.
It's not really
an epic, it's just long. By analogy to bxb and rxr, this program should
have been called exe, which would have created interesting possibilities
for confusion.
bxb(1)
, ecgeval(1)
, mxm(1)
, plotstm(1)
, rxr(1)
,
setdb(1)
, sumstats(1)
Evaluating ECG Analyzers (in the ECG Database Applications
Guide)
American National Standard for Ambulatory Electrocardiographs (publication
ANSI/AAMI EC38-1994); available from AAMI, 3330 Washington Blvd., Suite
400, Arlington, VA 22201 USA.
Table of Contents