0% found this document useful (0 votes)
26 views6 pages

Converting EEG, ECG and Other Paper Legated Biomedical Maps Into Digital Signals

This paper presents a software tool for converting biomedical maps recorded on paper, such as ECG and EEG charts, into digital signals without requiring specialized hardware. The tool uses image processing techniques like binarization, skew correction, and pixel-to-vector conversion to extract signal data from scanned images of the paper charts. This allows digitizing older analog biomedical recordings for inclusion in digital medical databases.

Uploaded by

Ankit Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views6 pages

Converting EEG, ECG and Other Paper Legated Biomedical Maps Into Digital Signals

This paper presents a software tool for converting biomedical maps recorded on paper, such as ECG and EEG charts, into digital signals without requiring specialized hardware. The tool uses image processing techniques like binarization, skew correction, and pixel-to-vector conversion to extract signal data from scanned images of the paper charts. This allows digitizing older analog biomedical recordings for inclusion in digital medical databases.

Uploaded by

Ankit Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/300796649

Converting EEG, ECG and other paper legated biomedical maps into digital
signals

Conference Paper · September 2003


DOI: 10.14209/sbrt.2007.31203

CITATIONS READS
9 1,464

3 authors, including:

Hélio Magalhães de Oliveira Rafael Dueire Lins


Federal University of Pernambuco Federal University of Pernambuco
208 PUBLICATIONS 694 CITATIONS 282 PUBLICATIONS 3,316 CITATIONS

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

PhD Thesis View project

Study of heavy tail distributions exploring information theory View project

All content following this page was uploaded by Hélio Magalhães de Oliveira on 10 April 2016.

The user has requested enhancement of the downloaded file.


XXV Simpósio Brasileiro de Telecomunicações, Setembro 3-6, Recife –PE, Brasil 1

Converting EEG, ECG and other paper legated


biomedical maps into digital signals
A. R. Gomes e Silva, H.M. de Oliveira, R.D. Lins

Abstract — This paper presents a digital signal processing computerized equipments. This kind of up-grade can be
tool developed using MatlabTM, which provides a very low- beneficial to small laboratories with modest resources.
cost and effective strategy for analog-to-digital conversion Nevertheless, it is not a trivial task to assemble or to design a
of legated paper biomedical maps without requiring set-box to convert signals. This study describes the
dedicated hardware. This software-based approach is development of a software tool intended to convert a version
particularly helpful for digitalizing biomedical signals of signals and/or spectra digitalized by a scanner (files of the
acquired from analogical devices equipped with a plotter. extension .jpg .tif .bmp etc.) to a data file, which can be
Albeit signals used in biomedical diagnosis are the efficiently processed and stored. It deals with an alternative
primary concern, this imaging processing tool is suitable approach to the classical A/D conversion without requiring
to modernize facilities in a non-expensive way. Legated any specific hardware.
paper ECG and EEG charts can be fast and efficiently
digitalized in order to be added in existing up-to-date II. AN A/D IMAGE-TO-DATA CONVERTER ALGORITHM
medical data banks, improving the follow-up of patients.

Keywords —- analog-to-digital converter, digitalization of Many relevant but old data are only available in a chart-format
medical maps, digital ECG, digital EEG. and the appending new data may be suitable. For instance, this
is precisely what happens in many long standing time series.
I. BACKGROUND AND SET-UP How to perform efficiently such a procedure?

D igital equipments are nowadays largely preferred to The following description is strongly based on ECG, but it can
analogical ones especially due to their high-quality and easily be adapted to other signals, either biological or not. An
flexibility of working with their output. Medical equipments implementation of the A/D platform on MATLABTM is
that use digital technology have emerged as a true revolution presented, exhibiting a few cases to illustrate the lines of the
in signal acquisition, analysis and diagnosis. Today, procedure.
electrocardiograms, electroencephalograms, electromyogram
and other biomedical signals are all digital. Digital signals S1. Digitalization of the paper strip
allow very high signal processing capabilities, easy storage, S2. Image binarization
transmission and retrieval of information. The well-recognized S3. Skew correction
advantages of digital technology turns it the first- choice. S4. Salt-and-pepper filtering
One of the limiting factors of adopting the digital technology S5. Axis identification
is the high cost of some modern digital equipment, overall S6. Pixel-to-vector conversion
some medical ones. This is a serious barrier to be crossed by S7. Removing the header and trailer of the acquired signal
those who already have a working analogical device and/or (used for device tuning)
face budget limitations. An alternative to device replacement S8. Splitting the ECG chart and re-assembling it.
is adopting an A/D-converter and a suitable interface to a
digital microcomputer or laptop. This would also allow
digitizing legated analogical data, something of paramount S1. Digitalization of the paper strip by scanner
importance in many areas, overall in medicine as the history The digitalizing process of the paper containing the chart to
acquire the data can be carried out at different resolutions.
of patients would be kept and case studies may be correlated, Higher resolutions turn feasible details identification on the
etc. acquired image, but for most applications require only a
A number of laboratories, medical institutes and hospitals resolution high enough to achieve acceptable digitalization
have only available analogical equipments, particularly those quality, claiming as small storage and scanning time as
equipped with plotters. The storage of these signals is rather requested. Tests were performed over EGC charts scanned at
inefficient and the data processing unfeasible. In this 100, 200, and 300 dpi. The paper strip scale is in millimetres,
challenging scenario, a substantial advance can be performed thus a 100 dpi resolution would theoretically be sufficient to
by designing acquisition cards with interface to record the signal information. However, in a number of cases
microcomputers, instead of purchasing sophisticated high-cost data from the ECG map was not retrieved at low resolution
(100 dpi) mainly due to the existing similarity between the
XXV Simpósio Brasileiro de Telecomunicações, Setembro 3-6, Recife –PE, Brasil 2

axis and the plotting trace. Besides that paper folding scanned S5. Axis identification
at 100 dpi may give rise to signal discontinuities. Several different types of data plotting were analysed for the
sake of the generality of the methodology proposed herein.
S2. Image binarization The piece of paper used to register the data may contain a
Image binarization is a process to translate a colour image into grid, a box, one horizontal line and one vertical line, or no
a binary image. It is a very widespread process in image axis, but in each case a specific analysis needs to be
processing, especially for images that contain neither artistic performed in order to adequately interpret the value of the
nor iconographic value. Since binarization reduces the number signal obtained, compensating offsets, etc.
of colours to a binary level, there are apparent gains in terms
of storage, besides simplifying the image analysis as S6. Pixel-to-vector conversion
compared to the true colour image processing [7]. However, For a better data retrieving from the image, vectors have twice
the ECG charts are always plotted on a grid. This grid the number of columns of pixels analyzed, because some
interferes on the automatic binarization process, and mainly peaks are found as successive vertical black lines for low
on data extracting due to the fact that it is not removed from resolution images. Each component of the vector is a complex
the binarized image. A handy way to suppress the grid is to number. The two components related to a same column have
perform an analysis of the RGB-channels so as to identify the identical real part, which is the column index of the “pixel
modal colour of the grid. A little tolerance around this level is matrix”. The two consecutive imaginary parts (same real part)
assumed and all colours within such an interval are then quantify the upper and lower limits of a vertical black line.
converted to white colour before binarization. In this analysis, For instance, the 2D-vector V=[…; 11+25i; 11+26i; …] has
we applied the binarization process by Otsu’s algorithm [6], coordinates meaning that the vertical black line spans from
since it has been shown to provide satisfactory results in many line 25 to line 26 at the column 11. Figure 1 deals with an
applications [7],[10]. Binarization is an important step in ECG chart with no axis. As an example, a stretch of the vector
moving from a biomedical map image towards a digital signal, used to plotting Figure 1(b) is
as the target of the process described herein is to obtain a
V = [10+26i; 10+26i; 11+25i; 11+26i; 12+25i; 12+26i;
sequence of values that correspond to the amplitude of a
13+26i; 13+27i 14+26i 14+28i 15+28i…].
uniform time series (see S6, below).
The algorithm searches the data since the first pixel (bottom-
S3. Skew correction left) until the last one (top-right). When there are no axis
A distortion often found in scanning processes is the skew present in the map (no clear vertical and horizontal bounds),
caused by the position of the paper on the scanner flatbed. the value of the bottom vertical and the first column positions
This rotation makes hard the analysis of data embedded in the are used as a reference for ECG scanning. If step 5 (S5) is able
image and increases the complexity of any sort of automatic to find axes of the graph, then these axes are assumed as data
image recognition. Whenever extracting data from a scanning reference.
digitalized chart even 0.5 degrees or less can introduce errors In order to convert the 2D-vector into one dimension, the
on the extracted data. The algorithm presented in [9] was used algorithm computes the modal distance (α) between the
here to correct the skew of the image taking as reference the imaginary parts of two consecutive components, which means
axis or the border of the paper strip. the amount of vertical black pixels composing the signal at a
specific column. If the difference between the imaginary
S4. Salt-and-pepper filtering components of the two coordinates is within the limit α, then
Salt and pepper noise is characterized by the presence of only the imaginary part of the second element is stored in the
isolated white and black pixels in a black-and-white image 1D version of the vector. This value is assumed as a reference
[2],[6]. It may bring technical hitches in analysis of the data. (β) to the peak identification in next column analysis. If this
In order to avoid a false identification of those pixels as piece difference is greater than α, the algorithm calculates the
of the analyzed chart, a filter was implemented to extract module of the difference between the β and each of the two
isolated pixels in the middle of a 3×3 matrix and a 3×2 matrix. components. The stored 1D-value is the one that gives the
greater value.
XXV Simpósio Brasileiro de Telecomunicações, Setembro 3-6, Recife –PE, Brasil 3

the process. Besides that, very often at the beginning and


ending of the data acquisition process a line is drawn carrying
no information. Such headers and trailers carry no real signal
information, thus they are removed from the generated vector
signal, as illustrated in the example presented in Figs. 3 to 5.

Box (fig. 3): The algorithm uses the information of the horizontal
and vertical lines to determine the limits used to acquire the data.

Fig. 1 – An ECG with no axis: (a) original scanned ECG,


(b) MatlabTM plotting of the ECG from the retrieved data.

Whenever leading with plotters, one often finds portions of


the chart where the drawing is no longer continuous. In order
to provide a one-dimension vector, the components at those
places are estimated through linear interpolation. Fig. 3 – Image of an ECG in a box, having some horizontal and vertical
dotted lines.
Data retrieving can be performed from a broad range of
medical-related plottings. Figure 2 shows an example of a
nuclear magnetic resonance (MNR) spectrum. Horizontal and
vertical lines differ from the box only by the fact that there is
no upper bound in data acquisition.

Fig. 4 – Plotting of signal vector corresponding to the image from Fig.


3 with header and trailer removed.

(a)

(b)
Fig. 2 – Example of data from a nuclear magnetic resonance (MNR) spectrum
(extracted from the public domain software package Wavelab). (a) Original Fig. 5 – Plotting of data retrieved from Fig. 3 after throwing away
scanned spectrum, (b) MatlabTM plotting from the corresponding data file. the first and final 16-values of the acquired data vector.

In appendix to this paper one may find two additional S8. Splitting the ECG chart and re-assembling it
examples of data extracted from ECG paper strips and the A trouble that arises whenever scanning an ECG and further
corresponding plotted data signal. The steps 1 to 6 are legated paper data signals is that usually the scanner flatbed
common to all image-to-vector conversion and a couple of does not cover the whole length of the paper strip, leading the
additional steps (7 and 8) can be occasionally required in a operator to scan it in separated parts. Special care and image
few specific cases. processing is needed to avoid loss or redundancy in data.
A possible solution to this problem is to insert in the paper
S7. Removing the header and trailer of the acquired signal strip easily detectable marks. During the tests, handmade
Typical ECG and a large number of ordinary graphs are marks were inserted on the paper strip, drawn by pen with no
composed either by boxes or horizontal and vertical lines the other tool or mechanical support. The mark should be
same colour as the plotting. Whenever those lines encompass sketched in a colour that is not originally present in the paper
parts of the area of the graphic, it becomes rather difficult to data strip. The image processing algorithm scans the image
remove the interference, since it can happen above and/or horizontally for one or two of such marks: only one mark on
below the graphic. As the process of data acquisition is done the first and on the last stretch, or two marks on the
by searching vertically, only the vertical lines interfere with intermediary ones. Those marks play the role of the horizontal
XXV Simpósio Brasileiro de Telecomunicações, Setembro 3-6, Recife –PE, Brasil 4

bounds in step 6. The vector is extracted from the beginning


of the image until the inserted mark for the first stretch, and IV. CLOSING REMARKS
then from the first mark to the second one for the intermediary Notwithstanding the fairly amount of scientific results, this
stretches, and finally from the last mark until the end of the paper describes the foundation of an efficient tool to generate
image for the last stretch. This supplementary step is only digital data signals from legated paper charts. The solution
performed for this kind of ECG and it is interleaved between proposed is a low-cost software tool that can be particularly
step 1and 2. After obtaining the vectors of each partial ECG, helpful to scientists and engineers. In particular, research
one can manipulate the data by appending segments or institutes, laboratories, clinical centres, hospitals and medical
analysing each vector separately. offices can largely have benefit of this up-and-coming
technique, particularly due to its user-friendliness, cost-
III. AN APLICATION OF SIGNAL PROCESSING TOOLS TO ECG effectiveness, and accuracy. One still can save data as
PAPER CHART
MatlabTM file or as ASCII files and edit or complement the
This section illustrates the application of the wavelet data.
decomposition [1] to the ECG shown in Fig. 2A (Appendix). One natural follow-up step to the tool presented herein is to
The algorithm proposed in this paper was first used to extract generalise the processing capability to multi-plotting paper
a MatlabTM data file as to allow the wavelet toolbox to be used charts, that also frequently appears in legated data. Besides
straight away. The acquired image was converted into a 1D that at a later stage we hope to generalise the tool to work with
vector that was loaded using the wavemenu command. As an signals recorded paper disks.
example, a three level decomposition of this ECG using the
Haar wavelet is shown in Figure 6. ACKNOWLEDGEMENTS. The authors are grateful to Mr.
Bruno T. Ávila for making available some C command lines.

REFERENCES

[1] H.M. de Oliveira, Análise de Sinais para Engenheiros: Uma Abordagem


via Wavelets, Rio de Janeiro: Brasport Livros e Multimídia, Book Series of the
Brazilian Telecommunications Society. 2007.

[2] B. Jähne, Digital Image Processing, 3rd ed. Springer, 1995.


Original ECG
[3] Data bank of Electrocardiograms, Available: http://www.ecglibrary.com

[4] E.W. Kamen and B.S. Heck, Fundamentals of Signals and Systems Using
Matlab. Englewood Cliffs, NJ: Prentice Hall, 1997.

[5] E.N. Bruce, Biomedical Signal Processing and Signal Modelling, Wiley,
Approximation
2001.

[6] R. C. Gonzalez and R. E. Woods, Digital Image Processing, 2nd ed.


Prentice Hall, 2001.

[7] J. M. M da Silva, R. D. Lins and V. C. da Rocha, Binarizing and Filtering


Detail (scale 1) Historical Documents with Back-to-Front Interference, in SAC ’06:
Proceedings of the 2006 ACM symposium on Applied computing, pp. 853-
858, ACM Press, 2006.

[8] N. Otsu, A Threshold Selection Method from Grayscale Document


Images, IEEE Trans. Syst.. Man Cybern. – SMC, vol. 9(1), pp. 62-66, 1979.

Detail (scale 2) [9] R. D. Lins and B. T. Ávila, A New Algorithm for Skew Detection in
Images of Documents, in Proceedings of ICIAR 2004, Lecture Notes in
Computer Science, vol. 3212, pp. 234-240, Springer Verlag, 2004.

[10] O. D. Trier, T. Taxt, Evaluation of Binarization Methods for Document


Images, IEEE Trans. Pattern Anal. Mach. Intell., vol. 17, no. 3, pp. 312-315,
1995.
Detail (scale 3)

Fig. 6 –Example of an ECG processing using the Haar wavelet


corresponding to ECG paper strip of the Fig. 2A. Analysis was
performed from the data acquired via the proposed algorithm.

III.
XXV Simpósio Brasileiro de Telecomunicações, Setembro 3-6, Recife –PE, Brasil 5

APPENDIX

In this appendix we present a couple of the data extracting from true ECG strips and show the plottings derived from the
retrieved data.

(Fig. 1A,2A): we first find out the pattern of the grid, by using the blue colour information, and then switch the pixel by white pixel.

(a)

(b)
Fig. 1A – Image of an ECG with red grid: (a) original ECG chart, (b) MatlabTM plotting of retrieved ECG with data file available.

(a)

(b)
Fig. 2A – Image of an ECG with green grid: (a) original ECG chart, (b) MatlabTM plotting of retrieved ECG with data file available.

(a)

Fig. 3A – Image of an ECG:


(a) Two ECG charts with red handmade marks drawn by pen (initial and intermediary portion), (b) MatlabTM plotting of retrieved ECG with data file available.

View publication stats

You might also like