Save 2 DICOM tag files
This commit is contained in:
parent
b33be224cb
commit
f6f87ba351
1 changed files with 61 additions and 21 deletions
82
src/pacs.py
82
src/pacs.py
|
@ -78,9 +78,37 @@ def dump(pane):
|
|||
# print(len(pane.children()))
|
||||
|
||||
|
||||
def save_tag(window, outdir):
|
||||
mouse_click(window['註釋/標籤'])
|
||||
TToolBar = window.child_window(class_name='TToolBar', found_index=2)
|
||||
|
||||
Button5 = TToolBar.Button5
|
||||
Button5.wait('ready', 9)
|
||||
# time.sleep(2)
|
||||
mouse_click(Button5)
|
||||
|
||||
export_to_file = window['輸出至檔案']
|
||||
export_to_file.wait('ready', 99)
|
||||
export = export_to_file.wrapper_object()
|
||||
export.click()
|
||||
|
||||
TDicomTagListForm = window['DICOM 標籤清單Dialog']
|
||||
|
||||
dlg_save = Desktop(backend="uia").window(title='另存新檔')
|
||||
NEdit = dlg_save['檔案名稱(N):Edit']
|
||||
NEdit.wait('ready', 99)
|
||||
edit = NEdit.wrapper_object()
|
||||
pahtname = os.path.join(outdir, edit.get_value())
|
||||
for p in glob.glob(pahtname + '*'):
|
||||
os.remove(p)
|
||||
edit.set_text(pahtname)
|
||||
dlg_save['存檔(S)Button'].wrapper_object().click()
|
||||
|
||||
TDicomTagListForm.close()
|
||||
|
||||
|
||||
def save_study(chartno, outdir):
|
||||
# TViewerForm
|
||||
|
||||
# while True:
|
||||
# logging.warning('connecting '+chartno)
|
||||
|
@ -111,38 +139,50 @@ def save_study(chartno, outdir):
|
|||
mouse_click(c)
|
||||
keyboard.send_keys('^i')
|
||||
|
||||
# logging.warning(str(TFlowPanel.get_properties()))
|
||||
# print(str(TFlowPanel.get_properties()))
|
||||
# print(str(window.get_properties()))
|
||||
# window.dump_tree(filename='test.log')
|
||||
# exit()
|
||||
|
||||
for c in series:
|
||||
|
||||
logging.warning(str(c.element_info))
|
||||
c.set_focus()
|
||||
mouse_click(c)
|
||||
|
||||
mouse_click(window['註釋/標籤'])
|
||||
TToolBar = window.child_window(class_name='TToolBar', found_index=2)
|
||||
keyboard.send_keys('^{HOME}')
|
||||
save_tag(window, outdir)
|
||||
keyboard.send_keys('^{END}')
|
||||
save_tag(window, outdir)
|
||||
# exit()
|
||||
|
||||
Button5 = TToolBar.Button5
|
||||
Button5.wait('ready', 9)
|
||||
time.sleep(2)
|
||||
mouse_click(Button5)
|
||||
# mouse_click(window['註釋/標籤'])
|
||||
# TToolBar = window.child_window(class_name='TToolBar', found_index=2)
|
||||
|
||||
export_to_file = window['輸出至檔案']
|
||||
export_to_file.wait('ready', 99)
|
||||
export = export_to_file.wrapper_object()
|
||||
export.click()
|
||||
# Button5 = TToolBar.Button5
|
||||
# Button5.wait('ready', 9)
|
||||
# time.sleep(2)
|
||||
# mouse_click(Button5)
|
||||
|
||||
TDicomTagListForm = window['DICOM 標籤清單Dialog']
|
||||
# export_to_file = window['輸出至檔案']
|
||||
# export_to_file.wait('ready', 99)
|
||||
# export = export_to_file.wrapper_object()
|
||||
# export.click()
|
||||
|
||||
dlg_save = Desktop(backend="uia").window(title='另存新檔')
|
||||
NEdit = dlg_save['檔案名稱(N):Edit']
|
||||
NEdit.wait('ready', 99)
|
||||
edit = NEdit.wrapper_object()
|
||||
pahtname = os.path.join(outdir, edit.get_value())
|
||||
for p in glob.glob(pahtname + '*'):
|
||||
os.remove(p)
|
||||
edit.set_text(pahtname)
|
||||
dlg_save['存檔(S)Button'].wrapper_object().click()
|
||||
# TDicomTagListForm = window['DICOM 標籤清單Dialog']
|
||||
|
||||
TDicomTagListForm.close()
|
||||
# dlg_save = Desktop(backend="uia").window(title='另存新檔')
|
||||
# NEdit = dlg_save['檔案名稱(N):Edit']
|
||||
# NEdit.wait('ready', 99)
|
||||
# edit = NEdit.wrapper_object()
|
||||
# pahtname = os.path.join(outdir, edit.get_value())
|
||||
# for p in glob.glob(pahtname + '*'):
|
||||
# os.remove(p)
|
||||
# edit.set_text(pahtname)
|
||||
# dlg_save['存檔(S)Button'].wrapper_object().click()
|
||||
|
||||
# TDicomTagListForm.close()
|
||||
# break
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue