Objective: Electrocardiography (ECG) is a key step in the diagnosis of cardiovascular pathology. Interpretation of the ECG is carried out by the doctor in the first minutes of severe patient admission and often determines further tactics of management. However, such an important diagnostic method is quite subjective, since it is highly dependent on the knowledge, and experience of the doctor and even on his attention to detail. The objective is to develop an application for automatic verification of various ECG criteria (exceptionally as an addition to the subjective interpretation of the doctor). Design and method: The desktop application was developed in Python (v3.10.5) by implementing its object-oriented programming concepts. Tkinter was chosen as a Graphical User Interface framework. The set of standard libraries has been supplemented by OpenCV (v4.6.0.66) for recognizing and digitizing ECG images, Pillow (v9.3.0) for manipulating the image and its metadata, NumPy (v1.23.5) for further analysis, and others. The initial version of the program includes STEMI recognition. Real ECGs printed on graph paper were used for debugging and testing. Results: When launching the application, the user is prompted to select a file containing an ECG image (a). After the required image has opened, the user should indicate the requested ECG-leads in the picture, following the simplest instructions (b). Then processing of the leads automatically starts. This phase is hidden from the user, and only a progress bar is displayed on the screen (c). Meanwhile, a number of manipulations are performed, such as converting the picture to a binary state, recognizing the ECG-line, and storing the coordinates of each pixel in the database. Objects of such classes as Isoline, and Cardiac Cycle with R wave, ST segment, etc. are created for each of the objects of the Lead class (d). Further geometric study of the pixel base and checking for the pathological ECG-signs on the backend form the final conclusion for the user (e). Conclusions: The developed application is relevant for use as an additional tool in the work and training of doctors. It can be expanded to cover a wide range of pathologies.
Read full abstract