|Next: PLOTxD(1) Up: WFDB Applications Guide Previous: NST(1)||On This Page|
Unless the -a option is used, this program produces at least these three files:
If invoked with the -v option, parsescp produces:
With -v, parsescp also writes a (very) detailed analysis of the contents of the SCP-ECG input on the standard output.
If parsescp was compiled with the WFDB library, and if it is invoked with the -w option, it also produces a pair of PhysioBank-compatible output files:
This program was written using AAMI SCP-1999 (Standard communications protocol for computer-assisted electrocardiography, 25 October 1999 draft) as a reference for SCP format. It has been tested only with SCP records produced by SpaceLabs/Burdick ECG carts (these produce second-difference encoded data with reference beat subtraction using a single reference beat, Huffman encoded using the SCP standard Huffman table). Amplitude (unencoded) data and first-difference encoded data should be readable using this program, but these formats have not been tested. Use of custom Huffman tables is recognized but not otherwise supported. Use of multiple reference beats is recognized but not otherwise supported.
Spacelabs/Burdick ECG carts of the type for which this program was designed record 2 of the 3 Einthoven leads and all 6 precordial leads simultaneously for 10 seconds, at 500 samples per second per lead, with 16-bit precision over a range of +/-32.767 mV. Thus the sampling interval is 2 ms, and the amplitude resolution is 5 microvolts (5000 nanovolts) per ADC unit.
Note that although the SCP standard specifies how to record the sampling frequency and amplitude resolution in SCP-ECG files, the Spacelabs/Burdick carts don’t do this, so parsescp assumes the sampling frequency and resolution above. parsescp will need modification in order to convert ECGs with other sampling frequencies or resolutions correctly.
derives the third Einthoven lead and the three augmented leads using the
standard relationships among the leads:
III = II - I
aVR = -(I + II)/2
aVL = II/2 - III
aVF = I/2 + III
In all of its output formats, parsescp represents the samples of each signal as a sequence of unscaled integers, exactly as they appear in the original SCP-ECG input file. Thus, in the .ecg, .txt, and .dat output files, the unit of amplitude is equivalent to 5 microvolts (5000 nanovolts), as in the SCP input. If the recording is shorter than 10 seconds, or if a signal is missing and cannot be reconstructed from the relationships above, each missing sample is assigned a special value (WFDB_INVALID_SAMPLE, or -32768).
The -l and -z options modify the input values as noted above; if neither option is used, the output sample values are numerically identical to the input sample values.
The .ecg file contains selected and rearranged segments
of the signals in the commonly-used layout of twelve 2.5 second segments
arranged in groups of 4 above a continuous 10-second lead II. Each sample
is represented as a big-endian 16-bit two’s complement signed integer. The
file begins with a 512-byte prolog containing the record name and recording
date and time, which are HIPAA-defined protected health information (PHI)
unless the input SCP-ECG has been deidentified. The prolog is followed by
four "traces", each representing the same 10-second interval. The first
three of these traces are made by concatenating 2.5 second segments (1250
samples) of each of the 12 leads, in this order:
( I aVR V1 V4)
( II aVL V2 V5)
(III aVF V3 V6)
The fourth trace is a continuous 10-second segment (5000 samples) of lead II.
The optional .txt and .dat files contain the ECG signals only (no metadata,
and no PHI). The signals appear in the standard order:
I, II, III, aVR, aVF, aVL, V1, V2, V3, V4, V5, V6
In the .txt file, each line begins with a sample number (0 to 4999) and is followed by a sample from each of the 12 leads, in order. Each sample is represented as a base 10 numeral, with spaces inserted between samples so that the columns line up. Thus the sample numbers are in column 0, samples of lead I are in column 1, those of lead II are in column 2, etc.
In the .dat file, the first 24 bytes contain the first sample of each signal, in the standard order as for the .txt file. As in the .ecg file, each sample is represented as a big-endian 16-bit two’s complement signed integer. The next 24 bytes contain the second sample of each signal, etc.
The .des file contains a variety of information extracted from the SCP-ECG input file, in human-readable form. It does not contain the ECG signals themselves, or the patient’s name or medical record number. Note that .des files made from SCP-ECG files that have not been anonymized will generally contain HIPAA-defined PHI (protected health information) such as the recording date and the patient’s age (even if over 90).
The .key file contains the recording date and time, the patient’s name, and the medical record number, if recorded in the input file.
The .hea file, if generated, contains metadata (information about the corresponding .dat file) only; it does not contain any PHI, even if the input was not anonymized. Age and sex are recorded in the .hea file if present in the input file, except that ages of 90 and more are recorded as 90. The recording date and time are not recorded in the .hea file.
The SCP-ECG standard defines how to record a variety of information that includes elements defined by HIPAA as PHI (protected health information). These include the patient’s name, medical record number, birth day and month, recording day and month, and (if the age is over 90) birth year and age.
If invoked with the -a option,
parsescp reads the input SCP-ECG file and writes an anonymized (deidentified)
version of it to the standard output. For example:
parsescp -a <12345678.scp >anonymous.scp
In this case, none of the other output files are produced.
parsescp removes all of the PHI as well as names of physicians and technicians, names of hospitals or clinics, and room numbers, replacing them with ’xxx’. It changes all dates to January 1, and if the age is over 90, it resets the age to 90 and the birth year to 90 years before the recording year. Finally, it recalculates the SCP-ECG CRCs so that the output is still a valid SCP-ECG file. Note that the original input file is not modified.
Note that parsescp does not deidentify other types of data (including its own .des and .key files); it can only deidentify SCP-ECG files.
It may be necessary to set and export the shell variable WFDB (see setwfdb(1) ).
Note that none of these commands modify the original input file (12345.scp).
Table of Contents
Up: WFDB Applications Guide
Please e-mail your comments and suggestions to email@example.com, or post them to:PhysioNet
Updated 28 May 2015