Skip to content

Commit

Permalink
ecg gen: resolution bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
deepanshi-s committed Jan 12, 2024
1 parent 234c264 commit 1053c23
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions codes/ecg-image-generator/ecg_plot.py
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@

standard_values = {'y_grid_size' : 0.5,
'x_grid_size' : 0.2,
'y_grid_inch' : 0.196,
'x_grid_inch' : 0.196,
'y_grid_inch' : 5/25.4,
'x_grid_inch' : 5/25.4,
'grid_line_width' : 0.5,
'lead_name_offset' : 0.5,
'lead_fontsize' : 11,
@@ -172,8 +172,8 @@ def ecg_plot(
width = papersize_values[papersize][1]
height = papersize_values[papersize][0]

y_grid = standard_values['y_grid_inch'] + random_sampler
x_grid = standard_values['x_grid_inch'] + random_sampler
y_grid = standard_values['y_grid_inch']
x_grid = standard_values['x_grid_inch']
y_grid_dots = y_grid*resolution
x_grid_dots = x_grid*resolution

4 changes: 2 additions & 2 deletions codes/ecg-image-generator/gen_ecg_image_from_data.py
Original file line number Diff line number Diff line change
@@ -88,8 +88,8 @@ def writeCSV(args):
if args.start_index != -1:
writer.writerow(["filename","xgrid","ygrid","lead_name","start","end"])

def run_single_file(args):
if args.seed != -1:
def run_single_file(args):
if hasattr(args, 'st') == True:
random.seed(args.seed)

filename = args.input_file
Original file line number Diff line number Diff line change
@@ -72,6 +72,7 @@ def get_parser():
return parser

def run(args):
random.seed(args.seed)

if os.path.isabs(args.input_directory) == False:
args.input_directory = os.path.normpath(os.path.join(os.getcwd(), args.input_directory))

0 comments on commit 1053c23

Please sign in to comment.