Skip to contents

Individual annotation types are described as both a command-line tool for annotating WFDB-files, as well as the extension that is appended to the record name to notate the type. Generally, the types of annotations that are supported are described below:

  • atr = manually reviewed and corrected reference annotation files

  • ann = general annotator file

  • ecgpuwave = files contain surface ECG demarcation (P, QRS, and T waves)

  • sqrs/wqrs/gqrs = standard WFDB peak detection for R waves

A more thorough explanation is given in the details. Additionally, files when being read in are converted from a binary format to a textual format. The raw data however may be inadequate, as the original annotation may be erroneous. In these cases, an empty annotation_table object will be returned.

Usage

read_annotation(
  record,
  record_dir = ".",
  annotator,
  wfdb_path = getOption("wfdb_path"),
  begin = "00:00:00",
  end = NA_character_,
  ...
)

write_annotation(
  data,
  annotator,
  record,
  record_dir = ".",
  wfdb_path = getOption("wfdb_path"),
  ...
)

annotate_wfdb(
  record,
  record_dir,
  annotator,
  wfdb_path = getOption("wfdb_path"),
  ...
)

Arguments

record

String that will be used to name the WFDB record. Cannot include extensions, and is not a filepath. alphanumeric characters are acceptable, as well as hyphens (-) and underscores (_)

record_dir

File path of directory that should be used read and write files. Defaults to current directory.

annotator

String that is the name of a WFDB-compatible annotation type, serving as the extension for the file that is written containing that annotation. Please see read_annotation() and write_annotation() for further details.

wfdb_path

Path that leads to installed wfdb software package on device. Needs to be directly set using set_wfdb_path(). Obtained from the system options on loading of the package, getOption('wfdb_path')

begin, end

A character in the format of HH:MM:SS that will be used to help parse the time of the annotation. These parameters together create the time range to extract. The default of 0 is a shortcut for 00:00:00. The seconds argument can include a decimal place.

...

Additional arguments to be passed to the function

data

An annotation_table containing the 6 invariant columns required by the annotation_table() function

Value

This function will either read in an annotation using the read_annotation() function in the format of an annotation_table object, or write to file/disk an annotation_table to a WFDB-compatible annotation file using the write_annotation() function.

IMPORTANT: as annotation files are created by annotators that were developed independently, there is a higher chance of an erroroneous file being created on disk. As such, this function will note an error an return an empty annotation_table at times.

Annotation files

The following annotation file types are described below.

ecgpuwave

ecgpuwave analyzes an ECG signal from the specified record, detecting the QRS complexes and locating the beginning, peak, and end of the P, QRS, and ST-T waveforms. The output of ecgpuwave is written as a standard WFDB-format annotation file (the extension is "*.ecgpuwave", as would be expected). This file can be converted into text format using rdann. Further details are given at the ECGPUWAVE page.

The type column can be p, t, or N for the peak of the P wave, T wave, and QRS (R peak) directly. The output notation also includes waveform onset XXX and waveform offset XXX. The number column gives further information about each of these type labels.

The number column gives modifier information. If the type classifier is a T wave annotation, the number column can be 0 (normal), 1 (inverted), 2 (positive), 3 (negative), 4 (biphasic negative-positive), 5 (biphasic positive-negative). If the type is an waveform onset or offset, then number can be 0 (P wave), 1 (QRS complex), 2 (T wave).