alphanumericslab / ecg-image-kit

A toolkit for analysis, synthesis, and digitization of electrocardiogram images
BSD 3-Clause "New" or "Revised" License
29 stars 22 forks source link

Strange vertical lines between leads? #14

Closed gpwhs closed 2 weeks ago

gpwhs commented 1 month ago

image

Why are these vertical lines added?

seems to occur due to this code in ecg_plot.py, but I don't understand why you've done this?

if columns > 1 and (i + 1) % columns != 0: sep_x = [len(ecg[leadName]) * step + x_offset + dc_offset + x_gap] * round(8 * y_grid_dots) sep_x = np.array(sep_x) sep_y = np.linspace(y_offset - 4 * y_grid_dots * step, y_offset + 4 * y_grid_dots * step, len(sep_x)) ax.plot(sep_x, sep_y, linewidth=line_width * 3, color=color_line)

rsameni commented 3 weeks ago

These are lead separator ticks, which exist on standard ECG images; but they shouldn't be as tall as in the example you provided. Please try the latest updates of the code. If the ticks are still as tall as shown in the image, please share the command-line parameters used to generate your example. Thank you!

matthewreyna commented 2 weeks ago

The tall lead separator ticks were caused by a bug in the ECG image generation code. Commit 27b90f5 fixes this bug.