Digitizing Paper ECGs and Other Plots

If your data are in printed form only, how can they be recovered for further
analysis? Although PhysioToolkit does not currently include software for this
application, many visitors are interested in digitizing plots such as ECG
recordings on paper or data plots from publications. This page offers a very
brief survey of resources that may be helpful.

Algorithms

Algorithms for digitizing paper ECGs (which can be applied to other XY plots as
well) are discussed in an excellent paper by JT Wang & DP Mital, A microcomputer-based prototype for ECG paper record
conversion, J Network and Comput Appl19(3):295-308
(1996). In addition to the authors' detailed account of their own techniques,
the paper includes a good bibliography.

Scanning a paper ECG

Use a color scanner with a resolution of at least 600 dpi, and scan the
original chart (which should have a red or other distinctively colored
grid). The results will be much worse if you have to work from black
and white images, because the grid will interfere with recovery of the
signals.

Any scanner software should work. Avoid the use of lossy compressed formats
(JPEG, GIF); PNG is a good choice, especially if you plan to use
ecg2png (below).

Cleaning up the scanned image (separating signals from the grid, etc.)

Larry Widman has written an open-source program for Linux called
ecg2png that does this job
very well; it can remove the grid or leave it in place as you prefer.

An additional benefit of using ecg2png is that it produces a very
compact 2- or 3-color image that displays quickly and cleanly in a web browser.
Larry's earlier work on digitizing paper ECGs is cited in both of the papers
mentioned above.

Converting a raster image to X-Y pairs

There are a few free programs that can do this:

Engauge
Digitizer: This is free (GPL) software for Linux and MS-Windows, which
should be portable to any other platform supported by the Qt toolkit.

WinDig: Free (binary only) for MS-Windows; very easy
to use and highly recommended.

DIGITIZE ("Computer Program to Digitize X-Y Plots for UNIX"):
formerly available from
http://www.anl.gov/LabDB/Current/Ext/H021-text.001.html but not
on-line as of March 2003. (If you know a current URL for this software,
please let me
know!)

NIH
Image: This is open-source image-processing software for the
Macintosh (MS-Windows and Java ports are also available). See Recovering Data from Line Plots in the NIH Image manual
for detailed instructions.

Among the commercial programs worth considering for this application are OPR (for MS-DOS; this
seems to be no longer available) and
FlexiTrace for
MacOS). There are other commercial programs for raster-to-vector conversion
that are less well-suited to this task but might be useable as an alternative.
Some of these are intended for GIS applications (e.g., digitizing paper maps);
others are sold by CAD software vendors and are designed to allow engineering
drawings to be scanned and imported into CAD programs; still others, such as
Adobe Streamline, are intended for graphic artists who want to be able to
manipulate line drawings without introducing raster artifacts. These are not
likely to work as well in this application as a specialized program such as
Engauge Digitizer, WinDig, DIGITIZE, OPR, or FlexiTrace, because they don't
exploit the knowledge that the curves to be traced have the form of a function
(i.e., that there is a unique ordinate for each abscissa).