def line_contour_splitbutton(dialog, window_name, number=1): viewer = False if "Viewer" in window_name: viewer = True window = supportingFunctions.find_window_func(window_name) if viewer is True: left, top, right, bottom = get_rect(dialog, window, True) else: left, top, right, bottom = get_rect(dialog, window) counter = 0 while counter < number: dialog.press_mouse_input( coords=(randint((left+50), (right-150)), randint((top+50), (bottom-50))), absolute=True) dialog.click_input( coords=(randint((left+50), (right-150)), randint((top+50), (bottom-50))), absolute=True) counter += 1 dialog.type_keys('{VK_ESCAPE}') # dialog.type_keys('^{BACKSPACE}') return
def curved_measurement_contour(dialog, window_name, number=5): viewer = False if "Viewer" in window_name: viewer = True window = supportingFunctions.find_window_func(window_name) if dialog.child_window(title="Toolbar", control_type="ToolBar").child_window( title="Curved Length Measurement").exists() is True: dialog.child_window(title="Toolbar", control_type="ToolBar").child_window( title="Curved Length Measurement").click_input() else: print "Curved Measurement Contour not available." return if viewer is True: left, top, right, bottom = get_rect(dialog, window, True) else: left, top, right, bottom = get_rect(dialog, window) counter = 0 while counter < number-1: dialog.click_input( coords=(randint((left+50), (right-150)), randint((top+50), (bottom-50))), absolute=True) counter += 1 dialog.click_input( coords=(randint((left + 50), (right - 150)), randint((top+50), (bottom-50))), absolute=True, double=True) dialog.type_keys('{VK_ESCAPE}') return
def load_series(dialog, study, window_name, series): window = supportingFunctions.find_window_func(window_name) command = "dialog.child_window(title=study, control_type='Window', found_index=0).SplitButton.Custom%s.\ drag_mouse_input(dst=dialog.%s.rectangle())" % (series + 4, window) exp_as_func = eval('lambda dialog, study, series: ' + command) if dialog.child_window( title=study, control_type='Window', found_index=0).SplitButton.Scrollbar.exists() is True: dialog.child_window( title=study, control_type='Window', found_index=0).SplitButton.Scrollbar.wheel_mouse_input( wheel_dist=60) if series > 6: dialog.child_window( title=study, control_type='Window', found_index=0).SplitButton.Scrollbar.wheel_mouse_input( wheel_dist=-4) else: pass exp_as_func(dialog, study, series) ###### CONSIDER WRITING METHOD if dialog.child_window(control_type="Window", found_index=0).exists() is True and \ dialog.child_window(title="OK Enter", control_type="Button").exists() is True: supportingFunctions.ignore_warning_message(dialog) return window
def line_contour(dialog, window_name, number=1): viewer = False if "Viewer" in window_name: viewer = True window = supportingFunctions.find_window_func(window_name) if dialog.child_window(title="Toolbar", control_type="ToolBar").child_window( title="Line Contour").exists() is True: dialog.child_window(title="Toolbar", control_type="ToolBar").child_window( title="Line Contour").click_input() else: print "Line Contour not available" return if viewer is True: left, top, right, bottom = get_rect(dialog, window, True) else: left, top, right, bottom = get_rect(dialog, window) counter = 0 while counter < number: dialog.press_mouse_input( coords=(randint((left+50), (right-150)), randint((top+50), (bottom-50))), absolute=True) dialog.click_input( coords=(randint((left+50), (right-150)), randint((top+50), (bottom-50))), absolute=True) counter += 1 dialog.type_keys('{VK_ESCAPE}') # dialog.type_keys('^{BACKSPACE}') return
def load_series(dialog, study, window_name, series=1): window = supportingFunctions.find_window_func(window_name) command = "dialog.child_window(title=study, control_type='Window', found_index=0).SplitButton.Custom%s.\ drag_mouse_input(dst=dialog.Custom2.%s.rectangle())" % (series + 4, window) exp_as_func = eval('lambda dialog, study, series: ' + command) if dialog.child_window( title=study, control_type='Window', found_index=0).SplitButton.Scrollbar.exists() is True: dialog.child_window( title=study, control_type='Window', found_index=0).SplitButton.Scrollbar.wheel_mouse_input( wheel_dist=60) if series > 6: dialog.child_window( title=study, control_type='Window', found_index=0).SplitButton.Scrollbar.wheel_mouse_input( wheel_dist=-4) else: pass exp_as_func(dialog, study, series) return
def flow_contour(dialog, window_name): window = supportingFunctions.find_window_func(window_name) x, y = get_rect_circular(dialog, window) dialog.press_mouse_input(coords=((x + 30), (y + 30))) dialog.move_mouse_input(coords=((x + 20), (y - 20))) dialog.move_mouse_input(coords=((x - 20), (y - 20))) dialog.release_mouse_input(coords=((x - 10), (y - 10)))
def draw_lv_extent(dialog, window_name): window = supportingFunctions.find_window_func(window_name) left, top, right, bottom = get_rect(dialog, window) # print left, top, right, bottom counter = 0 while counter < 3: dialog.click_input( coords=(randint((left + 50), (right - 70)), randint((top + 50), (bottom - 50))), absolute=True) counter += 1 return
def curved_measurement_contour_splitbutton(dialog, window_name, number=5): window = supportingFunctions.find_window_func(window_name) left, top, right, bottom = get_rect(dialog, window) counter = 0 while counter < number-1: dialog.click_input( coords=(randint((left+50), (right-150)), randint((top+50), (bottom-50))), absolute=True) counter += 1 dialog.click_input( coords=(randint((left + 50), (right - 150)), randint((top+50), (bottom-50))), absolute=True, double=True) dialog.type_keys('{VK_ESCAPE}') return
def draw_epi_endo(dialog, window_name): window = supportingFunctions.find_window_func(window_name) left, top, right, bottom = get_rect(dialog, window) dialog.press_mouse_input( coords=(randint((left + 50), (right - 150)), randint((top + 50), (bottom - 50))), absolute=True) counter = 0 while counter < 4: dialog.move_mouse_input( coords=(randint((left + 50), (right - 150)), randint((top + 50), (bottom - 50))), absolute=True) counter += 1 dialog.release_mouse_input( coords=(randint((left + 50), (right - 150)), randint((top + 50), (bottom - 50))), absolute=True) dialog.type_keys('{VK_ESCAPE}') return