ANN2RR(1)

NAME
ann2rr, rr2ann - convert annotation files to interval lists and vice versa

SYNOPSIS
ann2rr -r record -a annotator [ options ... ]
rr2ann -r record -a annotator [ options ... ]

DESCRIPTION
These programs are typically used to obtain RR interval series from ECG annotation files, or to create an annotation file from such a series, but they have a wider range of uses.

Use ann2rr to extract a list of intervals, in text format, from an annotation file. By default, the intervals are listed in units of sample intervals (use sampfreq(1) to determine the sampling frequency of the input record if necessary). Options for ann2rr include:

-c  Print intervals between consecutive valid annotations only. (See discussion below).

-f time
    Begin at the specified time. By default, ann2rr starts at the beginning of the record.

-h  Print a usage summary.

-p type [ type ... ]
    Print intervals between annotations of the specified types only. The type arguments should be annotation mnemonics (e.g., N), as normally printed by rdann(1) in the third column. More than one -p option may be used in a single command, and each -p option may have more than one type argument following it. If type begins with ``-'', however, it must immediately follow -p (standard annotation mnemonics do not begin with ``-'', but modification labels in an annotation file may define such mnemonics).

-t time
    Stop at the specified time.

-v, -vs, -vm, -vh, -V, -Vs, -Vm, -Vh
    Print the elapsed times from the beginning of the record to the annotations that begin each interval, as sample number (using -v), or in seconds (using -vs), minutes (using -vm), or hours (using -vh) before each heart rate value. The options -V, -Vs, -Vm, and -Vh work in the same way, but the printed times are those for the annotations that end the intervals. Only one of these options can be used at a time; if none is chosen, only the RR intervals are printed, in units of sample intervals. When using -vs, -vm, -vh, -Vs, -Vm, or -Vh, intervals are printed in units of seconds.

The -c option, used without the -p option, causes ann2rr to filter out intervals between beats that have intervening non-beat annotations, such as rhythm or signal quality change annotations. Used with the -p option, the -c option causes ann2rr to reject intervals between annotations of the type(s) specified by -p if there are annotations of any other types intervening; thus, for example, the combination of -c and -p N would yield only intervals between consecutive normal beats, and intervals between pairs of normal beats surrounding an ectopic beat would be discarded from the output.

Use rr2ann to create an annotation file from the standard input, which should usually be a list of intervals in the format produced by ann2rr. (For exceptions, see -T and -x below.) Only the first token on each line is taken as an interval; anything else on the same line is ignored, as are empty lines, spaces and tabs at the beginning of a line, non-numeric tokens and anything following them on the same line, negative intervals, and zero intervals. The output consists of a binary annotation file (record.annotator), and (if it does not exist already, a text header file (record.hea). Options for rr2ann include:

-F frequency
    Assume the specified sampling frequency. This option has no effect unless it is necessary for rr2ann to create a header file; in this case, a sampling frequency of 250 Hz is assumed if the -F option is omitted.

-h  Print a usage summary.

-T  Interpret the input as times of occurrence, rather than as intervals.

-x n
    Multiply input by n to obtain intervals (or, if -T is also used, times of occurrence) in units of sample intervals). Default: n = 1.

Note that wrann(1) also provides a way to generate an annotation file from text. Unlike that of rr2ann, wrann's input format permits specifying annotation types and other fields in addition to the times of occurrence.

The shell variable WFDB should be set and exported (see setwfdb(1)).

FILES

record.hea
    header file

record.annotator
    annotation file

SEE ALSO
rdann(1), sampfreq(1), setwfdb(1), wrann(1)

AUTHOR
George B. Moody (george@mit.edu)

SOURCE
http://www.physionet.org/physiotools/wfdb/app/ann2rr.c
http://www.physionet.org/physiotools/wfdb/app/rr2ann.c