From cab8f88c665d5d3b71ef388892d28741c7443c23 Mon Sep 17 00:00:00 2001 From: Deepanshi Date: Thu, 23 May 2024 09:13:47 -0400 Subject: [PATCH] ecg gen: added comments in the header file --- codes/ecg-image-generator/helper_functions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codes/ecg-image-generator/helper_functions.py b/codes/ecg-image-generator/helper_functions.py index fbc7112..84fbeab 100644 --- a/codes/ecg-image-generator/helper_functions.py +++ b/codes/ecg-image-generator/helper_functions.py @@ -340,4 +340,8 @@ def write_wfdb_file(ecg_frame, filename, rate, header_file, write_dir, full_mode adc_gain = header.adc_gain, baseline = header.baseline, base_time = header.base_time, base_date = header.base_date, write_dir = write_dir) - \ No newline at end of file + + with open(os.path.join(write_dir, tail + '.hea'), "a") as f: + for line in header.comments: + f.write("#" + line) + f.write("\n") \ No newline at end of file