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()))
|
# 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):
|
def save_study(chartno, outdir):
|
||||||
|
# TViewerForm
|
||||||
|
|
||||||
# while True:
|
# while True:
|
||||||
# logging.warning('connecting '+chartno)
|
# logging.warning('connecting '+chartno)
|
||||||
|
@ -111,38 +139,50 @@ def save_study(chartno, outdir):
|
||||||
mouse_click(c)
|
mouse_click(c)
|
||||||
keyboard.send_keys('^i')
|
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:
|
for c in series:
|
||||||
|
|
||||||
logging.warning(str(c.element_info))
|
logging.warning(str(c.element_info))
|
||||||
c.set_focus()
|
c.set_focus()
|
||||||
mouse_click(c)
|
mouse_click(c)
|
||||||
|
|
||||||
mouse_click(window['註釋/標籤'])
|
keyboard.send_keys('^{HOME}')
|
||||||
TToolBar = window.child_window(class_name='TToolBar', found_index=2)
|
save_tag(window, outdir)
|
||||||
|
keyboard.send_keys('^{END}')
|
||||||
|
save_tag(window, outdir)
|
||||||
|
# exit()
|
||||||
|
|
||||||
Button5 = TToolBar.Button5
|
# mouse_click(window['註釋/標籤'])
|
||||||
Button5.wait('ready', 9)
|
# TToolBar = window.child_window(class_name='TToolBar', found_index=2)
|
||||||
time.sleep(2)
|
|
||||||
mouse_click(Button5)
|
|
||||||
|
|
||||||
export_to_file = window['輸出至檔案']
|
# Button5 = TToolBar.Button5
|
||||||
export_to_file.wait('ready', 99)
|
# Button5.wait('ready', 9)
|
||||||
export = export_to_file.wrapper_object()
|
# time.sleep(2)
|
||||||
export.click()
|
# 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='另存新檔')
|
# TDicomTagListForm = window['DICOM 標籤清單Dialog']
|
||||||
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()
|
# 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
|
# break
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue