BXB(1)

NAME
bxb - ANSI/AAMI-standard beat-by-beat annotation comparator

SYNOPSIS
bxb -r record -a reference-annotator test-annotator [ options ... ]

DESCRIPTION

This program implements the beat-by-beat comparison algorithm described in Testing and Reporting Performance Results of Ventricular Arrhythmia Detection Algorithms, an AAMI Recommended Practice (AAMI ECAR-1987). Using options -C, -L, or -S, bxb implements the beat-by-beat comparison algorithm specified by the current American National Standard for ambulatory ECG analyzers (ANSI/AAMI EC38-1994). bxb is the reference implementation of these algorithms, and must be used to obtain the beat-by-beat performance statistics cited in EC38 in order to be in compliance with the standard. The EC38 comparison algorithm includes all of the ECAR statistics (so that both sets of requirements are satisfied by using the EC38 algorithm), with additional statistics on detection of supraventricular ectopic beats (SVEBs). The -C, -L, and -S options also gather statistics on RR interval errors, which were considered for inclusion in EC38, but were eventually dropped from it.

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 (called the `algorithm' annotation file in EC-38 and in ECAR).

Options include:

-c file
    Append condensed reports (ECAR Table 6 format) to file.

-C file
    As for -c, but report RMS RR interval error and SVEB statistics also.

-f time
    Begin the comparison at the specified time (default: 5 minutes after the beginning of the record).

-h  Print a usage summary.

-l file1 file2
    Append line-format reports (ECAR Tables 7 and 8 format) to file1 and file2 respectively (see below).

-L file1 file2
    As for -l, but report RMS RR interval error and SVEB statistics also.

-o  Generate an output annotation file (see below).

-O  Generate an expanded output annotation file (see below).

-s file
    Append standard reports (ECAR Table 3 format) to file.

-S file
    As for -s, but report RMS RR interval error and SVEB statistics also.

-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  Verbose mode (list all beat label discrepancies; see below).

-w time
    Set the match window (default: 0.15 seconds; see below).

The statistics gathered by bxb are based on tallies of `matching' annotations in the reference and test annotation files. Matching annotations need not have exactly equal annotation times; the match window specifies the maximum absolute difference in annotation times that is permitted for matching annotations. bxb measures the total shutdown time in the test annotation file as the sum of all intervals that begin with a `shutdown' annotation and that end with a `resume' annotation. (If a period of shutdown does not end before the end of the record, the creator of the annotation file should nevertheless write a `resume' annotation at the end of the record, in order to permit correct shutdown accounting.) This program follows the convention for `shutdown' and `resume' annotations adopted for reference annotation files of the European ST-T database, a convention compatible with that established for the MIT-BIH Arrhythmia Database: `shutdown' annotations are NOISE annotations with bits 4 and 5 (i.e., the `16' bit and the `32' bit) of the subtype field both set; `resume' annotations are NOISE annotations with any other subtype. The convention used in AHA Database reference files, in which unreadable intervals are marked by only one `shutdown' annotation placed near the middle of the interval, is also acceptable; in this case, shutdown is assumed to begin 150 ms after the previous annotation, and it is assumed to end 150 ms before the following annotation.

At most one of -c, -C, -l, -L, -O, -s, and -S can be given as an option. If `-' is given as a file argument, reports are written on the standard output. If no options are specified, bxb writes standard reports on the standard output (equivalent to using the option -s -). 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, bxb can be used repeatedly to build up a line-format table for multiple records, for further processing by sumstats(1).

The -o option produces an output annotation file with annotator name bxb. The output annotation file contains exact copies of all of the test annotator's beat labels that match those of the reference annotator, as well as NOTE annotations that describe all mismatches. Mismatched annotation types are mapped into the AAMI `test label' mnemonics (N, V, F, Q, O, and X; if the -C, -L, or -S option is also specified, the mnemonics also include S). The `aux' field of each NOTE annotation indicates the element of the confusion matrix in which the mismatch is tallied (e.g., Nv represents an event called a normal beat by the reference annotator and a ventricular ectopic beat by the test annotator). NOTE annotations that correspond to beats missed by the test annotator are placed at the sample indicated by the reference annotation; all others are placed at that indicated by the test annotation.

The -O option produces a similar output annotation file, in this case containing not only beat labels but all others as well. No summary report is produced if -O is specified. NOTE annotations produced using -O contain unmapped annotation mnemonics from the input annotation files. This option, if used together with -f 0 -w 0, identifies all discrepancies between a pair of annotation files. It can be especially useful for developing reference annotation files for new records.

The -v option specifies that each beat label mismatch is described on the standard output in a format similar to:
    N(120188)/V(120191)
where the letters indicate the AAMI mnemonics corresponding to the reference and test annotators' beat labels, and the numbers indicate the time fields (sample numbers) of the reference and test annotations respectively. Note that O and X mnemonics are generated by bxb as placeholders for missing beat labels; you will not find them in the input annotation files.

The shell variable DB should be set and exported (see setdb(1)).

DIAGNOSTICS

non-standard comparison selected
    The -f, -O, -t, and -w options modify the comparison algorithm used by bxb in ways not permitted by ECAR or 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.

SEE ALSO
ecgeval(1), epic(1), mxm(1), rxr(1), setdb(1), sumstats(1)
Evaluating ECG Analyzers (in the ECG Database Applications Guide)
Testing and Reporting Performance Results of Ventricular Arrhythmia Detection Algorithms (publication AAMI ECAR-1987)
American National Standard for Ambulatory Electrocardiographs (publication ANSI/AAMI EC38-1994)
The last two publications are available from AAMI, 3330 Washington Blvd., Suite 400, Arlington, VA 22201 USA.