|Next: ANN2RR(1) Up: WFDB Applications Guide Previous: FAQ||On This Page|
To read from an AHA DB DVD:
ahaecg2mit [ -s ] ahafile.* ...
To read from an AHA DB CD:
ahaconvert ahafile.cmp ...
To read from an AHA DB floppy disk or 9-track tape:
a2m -i ahafile -r record -a annotator [ options ... ]
ad2m -i ahafile -r record [ options ... ]
To convert a WFDB record to AHA tape format:
m2a -r record -a WFDB-annotator AHA-annotator [ options ... ]
md2a -o ahafile -r record [ options ... ]
The AHA Database for Evaluation of Ventricular Arrhythmia Detectors (AHA DB) has been distributed since 1983 by ECRI (http://www.ecri.org), in at least four formats:
The AHA DB consists of a development set of 80 records (which were created by the BCL between 1976 and 1983 and have been distributed by ECRI since then) and a test set of 75 records (also created by the BCL between 1976 and 1983, but not distributed until about 20 years later). Each record contains two simultaneous ECG signals that have been digitized for three hours continuously, and beat annotations for the final 30 minutes of the signals in each record. The records have been distributed in two versions: a long version (records named n0nn and n1nn) containing the full three hours of signals, and a short version (records named n2nn and n3nn) containing only the final 35 minutes of signals (including all of the annotated beats).
ECRI currently supplies the AHA DB only on DVDs, so the tape and compressed formats are primarily of historical interest. The programs described below convert these formats into WFDB (also known as PhysioBank or MIT) format. Long version input files can be converted in their entirety, or these programs can create short version records from either long or short version inputs. The last two programs below convert WFDB records to AHA tape format (conversion to AHA DB DVD and CD/floppy disk distribution formats is not supported). All of these programs print a brief usage summary if invoked with no command-line arguments, or with a -h option.
Note that records in WFDB format can be excerpted and reformatted in more generally useful ways using snip(1) or xform(1) .
Use ahaecg2mit to convert .txt or .ecg files from an AHA DB DVD into WFDB-compatible records. One or more input filenames may be supplied as command-line arguments; each specified input file is converted into a WFDB record, including a .hea (header) file, a .dat (signal) file, and a .atr (reference annotation) file. If the first command-line argument is -s, then ahaecg2mit produces short-form records with the correct (n2nn or n3nn) record names.
If the .txt or .ecg files are not in the current directory, give their full pathnames. The output files are always written to the current directory, so be sure that the current directory is writeable (it should not be the DVD) and that has sufficient free space (roughly 8 Mb per long version record, or 1.6 MB per short version record).
Use ahaconvert to convert one or more records from an AHA DB CD-ROM into WFDB format. Run ahaconvert without any command-line arguments for instructions, or see the examples below. Note: ahaconvert is a shell script; to use it successfully, you will need to have a shell (standard with all versions of Unix, and included in the free Cygwin package for MS-Windows) as well as ad2m and a2m, which perform the actual work of the conversion.
Use a2m to convert AHA-format annotation files from tapes, floppy disks, or CDs into WFDB format. Options for a2m include:
Use ad2m to convert AHA-format signal files from tapes, floppy disks, or CDs into WFDB format. Options for ad2m include:
Use m2a to convert WFDB-format annotation files into AHA tape format. Options for m2a include:
Use md2a to convert WFDB-format signal files into AHA tape format. Options for md2a include:
It may be necessary to set and export the shell variable WFDB (see setwfdb(1) ).
To convert the long-version records only, type:
To obtain the same files given a ‘short version’
9-track distribution tape, copy the second and third files from the tape
into files 1201.tap and 1201.ann in the current directory, then type:
ad2m -i 1201.tap -r 1201
a2m -i 1201.ann -r 1201 -a atr -t 1
The names for the files copied from the tape are arbitrary, but do not use names of files to be generated by ad2m or a2m (see the previous example). Note that the first and fourth files on the distribution tape contain an ‘id’ block, which can be read by readid (a program included in the convert directory of the WFDB Software Package) to verify the record name. Distribution tapes that contain more than one record contain additional sets of four files, always in the same order within each set.
make a version of the three-hour AHA DB record 1001 in WFDB format, given
the ‘long version’ distribution tape, copy the second and third files from
the tape into files 1001.tap and 1001.ann in the current directory, then
ad2m -i 1001.tap -r 1001 -t 3:0:0
a2m -i 1001.ann -r 1001 -a atr -t 2
The -t 3:0:0 option is necessary to prevent ad2m from truncating the signal file after the first 35 minutes.
To make a version of AHA DB record 1201 in WFDB format,
given a ‘long version’ 9-track distribution tape containing the corresponding
three-hour record 1001, copy the second and third files from the tape into
files 1001.tap and 1001.ann in the current directory, then type:
ad2m -i 1001.tap -r 1201 -f 2:25:0
a2m -i 1001.ann -r 1201 -a atr -t 1
In this case, the -f option instructs ad2m to skip the first two hours and 25 minutes of the ‘long-version’ AHA signal file, and to reformat the remainder (equivalent to the 35-minute ‘short-version’ record). The -t 1 option is used with a2m even though its input file comes from a ‘long-version’ tape, because the annotation times must be shifted only by the amount necessary for a ‘short-version’ tape in this case.
To keep both versions (1001 and 1201) on-line,
make the long version first (see above), then type:
a2m -i 1001.ann -r 1201 -a atr -t 1
to make a short version reference annotation file. Continue (under UNIX) by:
cp 1001.hea 1201.hea
or (under MS-DOS) by:
copy 1001.hea 1201.hea
and edit 1201.hea, replacing ‘1001’ in the first line (only!) with ‘1201’, and replacing ‘212’ in the second and third lines by ‘212+6525000’ (see the description of the ‘byte offset’ field in header(5) ). Although each version needs its own header and reference annotation files, the long-version signal file can be shared with the short version, allowing a substantial savings in storage requirements. Note that WFDB application programs that read the ‘short version’ record 1201 signal file may report signal checksum errors at the end of the record, unless you also recalculate the signal checksums (easily done using snip(1) to copy the record; delete the copy once the checksums have been obtained).
Table of Contents
Up: WFDB Applications Guide
Please e-mail your comments and suggestions to firstname.lastname@example.org, or post them to:PhysioNet
Updated 8 March 2019