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