1
2
3
4
5
6 import wx
7
8
9 import gettext
10
11
12
13 from Gnumed.wxpython.gmListWidgets import cReportListCtrl
14 from Gnumed.wxpython.gmTextCtrl import cTextCtrl
15
16
17
20
21 kwds["style"] = kwds.get("style", 0) | wx.BORDER_NONE | wx.TAB_TRAVERSAL
22 wx.Panel.__init__(self, *args, **kwds)
23 self.__lbl_host = wx.StaticText(self, wx.ID_ANY, _("Host:"))
24 self._TCTRL_host = cTextCtrl(self, wx.ID_ANY, "")
25 self.__lbl_port = wx.StaticText(self, wx.ID_ANY, _("Port:"))
26 self._TCTRL_port = cTextCtrl(self, wx.ID_ANY, "")
27 self.__lbl_user = wx.StaticText(self, wx.ID_ANY, _("User:"))
28 self._TCTRL_user = cTextCtrl(self, wx.ID_ANY, "")
29 self.__lbl_password = wx.StaticText(self, wx.ID_ANY, _("Password"))
30 self._TCTRL_password = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_PASSWORD)
31 self._BTN_connect = wx.Button(self, wx.ID_ANY, _("&Connect"), style=wx.BU_EXACTFIT)
32 self._LBL_PACS_identification = wx.StaticText(self, wx.ID_ANY, _("<not connected>"))
33 self._LBL_patient_identification = wx.StaticText(self, wx.ID_ANY, "")
34 self._LCTRL_studies = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT)
35 self._LCTRL_series = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT)
36 self._LCTRL_details = cReportListCtrl(self, wx.ID_ANY, style=wx.BORDER_NONE | wx.LC_REPORT)
37 self._TCTRL_details = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_BESTWRAP | wx.TE_MULTILINE | wx.TE_READONLY)
38 self._BMP_preview = wx.lib.statbmp.GenStaticBitmap(self, wx.ID_ANY, wx.Bitmap(50, 50), style=wx.BORDER_SIMPLE)
39 self._LBL_image = wx.StaticText(self, wx.ID_ANY, _("Image"))
40 self._BTN_verify_patient_data = wx.Button(self, wx.ID_ANY, _("Patient"), style=wx.BU_EXACTFIT)
41 self._BTN_previous_image = wx.Button(self, wx.ID_ANY, _(u"\u25c4"), style=wx.BU_EXACTFIT)
42 self._BTN_next_image = wx.Button(self, wx.ID_ANY, _(u"\u25ba"), style=wx.BU_EXACTFIT)
43 self._BTN_image_export = wx.Button(self, wx.ID_ANY, _("E&xport"), style=wx.BU_EXACTFIT)
44 self._BTN_browse_study = wx.Button(self, wx.ID_ANY, _("Browse"), style=wx.BU_EXACTFIT)
45 self._BTN_browse_patient = wx.Button(self, wx.ID_ANY, _("Browse"), style=wx.BU_EXACTFIT)
46 self._BTN_browse_pacs = wx.Button(self, wx.ID_ANY, _("Browse"), style=wx.BU_EXACTFIT)
47 self._BTN_image_show_dicom = wx.Button(self, wx.ID_ANY, _("&Show (D)"), style=wx.BU_EXACTFIT)
48 self._BTN_save_image_as_dicom = wx.Button(self, wx.ID_ANY, _("Save (&D)"), style=wx.BU_EXACTFIT)
49 self._BTN_save_studies_as_dicom_dir = wx.Button(self, wx.ID_ANY, _("Save"), style=wx.BU_EXACTFIT)
50 self._BTN_save_patient_as_dicom_dir = wx.Button(self, wx.ID_ANY, _("Save"), style=wx.BU_EXACTFIT)
51 self._BTN_upload = wx.Button(self, wx.ID_ANY, _("&Upload"), style=wx.BU_EXACTFIT)
52 self._BTN_image_show = wx.Button(self, wx.ID_ANY, _("Show (&P)"), style=wx.BU_EXACTFIT)
53 self._BTN_save_image_preview = wx.Button(self, wx.ID_ANY, _("Save (P)"), style=wx.BU_EXACTFIT)
54 self._BTN_save_studies_as_zip = wx.Button(self, wx.ID_ANY, _("as ZIP"), style=wx.BU_EXACTFIT)
55 self._BTN_save_patient_as_zip = wx.Button(self, wx.ID_ANY, _("as ZIP"), style=wx.BU_EXACTFIT)
56 self._BTN_modify_orthanc_content = wx.Button(self, wx.ID_ANY, _("Edit"), style=wx.BU_EXACTFIT)
57
58 self.__set_properties()
59 self.__do_layout()
60
61 self.Bind(wx.EVT_BUTTON, self._on_connect_button_pressed, self._BTN_connect)
62 self.Bind(wx.EVT_BUTTON, self._on_verify_patient_data_button_pressed, self._BTN_verify_patient_data)
63 self.Bind(wx.EVT_BUTTON, self._on_previous_image_button_pressed, self._BTN_previous_image)
64 self.Bind(wx.EVT_BUTTON, self._on_next_image_button_pressed, self._BTN_next_image)
65 self.Bind(wx.EVT_BUTTON, self._on_button_image_export_pressed, self._BTN_image_export)
66 self.Bind(wx.EVT_BUTTON, self._on_browse_study_button_pressed, self._BTN_browse_study)
67 self.Bind(wx.EVT_BUTTON, self._on_browse_patient_button_pressed, self._BTN_browse_patient)
68 self.Bind(wx.EVT_BUTTON, self._on_browse_pacs_button_pressed, self._BTN_browse_pacs)
69 self.Bind(wx.EVT_BUTTON, self._on_button_image_show_dicom_pressed, self._BTN_image_show_dicom)
70 self.Bind(wx.EVT_BUTTON, self._on_save_image_as_dicom_button_pressed, self._BTN_save_image_as_dicom)
71 self.Bind(wx.EVT_BUTTON, self._on_save_studies_as_dicom_dir_button_pressed, self._BTN_save_studies_as_dicom_dir)
72 self.Bind(wx.EVT_BUTTON, self._on_save_patient_as_dicom_dir_button_pressed, self._BTN_save_patient_as_dicom_dir)
73 self.Bind(wx.EVT_BUTTON, self._on_upload_button_pressed, self._BTN_upload)
74 self.Bind(wx.EVT_BUTTON, self._on_button_image_show_pressed, self._BTN_image_show)
75 self.Bind(wx.EVT_BUTTON, self._on_save_image_preview_button_pressed, self._BTN_save_image_preview)
76 self.Bind(wx.EVT_BUTTON, self._on_save_studies_as_zip_button_pressed, self._BTN_save_studies_as_zip)
77 self.Bind(wx.EVT_BUTTON, self._on_save_patient_as_zip_button_pressed, self._BTN_save_patient_as_zip)
78 self.Bind(wx.EVT_BUTTON, self._on_modify_orthanc_content_button_pressed, self._BTN_modify_orthanc_content)
79
80
82
83 self._TCTRL_host.SetToolTip(_("Enter the PACS host address."))
84 self._TCTRL_port.SetToolTip(_("Enter the PACS port."))
85 self._TCTRL_user.SetToolTip(_("Enter the PACS user."))
86 self._TCTRL_password.SetToolTip(_("Enter the PACS password. It will not be shown."))
87 self._BTN_connect.SetToolTip(_("Connect to PACS."))
88 self._LCTRL_details.SetFont(wx.Font(9, wx.MODERN, wx.NORMAL, wx.NORMAL, 0, ""))
89 self._TCTRL_details.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND))
90 self._TCTRL_details.SetFont(wx.Font(9, wx.MODERN, wx.NORMAL, wx.NORMAL, 0, ""))
91 self._TCTRL_details.Hide()
92 self._BMP_preview.SetMinSize((50, 50))
93 self._BTN_verify_patient_data.SetToolTip(_("Verify patient data in PACS."))
94 self._BTN_verify_patient_data.Enable(False)
95 self._BTN_previous_image.SetToolTip(_("Review previous image."))
96 self._BTN_previous_image.Enable(False)
97 self._BTN_next_image.SetToolTip(_("Preview next image."))
98 self._BTN_next_image.Enable(False)
99 self._BTN_image_export.SetToolTip(_("Store image into export area."))
100 self._BTN_image_export.Enable(False)
101 self._BTN_browse_study.SetToolTip(_("Browse topmost selected study."))
102 self._BTN_browse_study.Enable(False)
103 self._BTN_browse_patient.SetToolTip(_("Browse overview of all studies for this patient."))
104 self._BTN_browse_patient.Enable(False)
105 self._BTN_browse_pacs.SetToolTip(_("Browse PACS at top level."))
106 self._BTN_browse_pacs.Enable(False)
107 self._BTN_image_show_dicom.SetToolTip(_("Show image in DICOM viewer."))
108 self._BTN_image_show_dicom.Enable(False)
109 self._BTN_save_image_as_dicom.SetToolTip(_("Save image in DICOM format."))
110 self._BTN_save_image_as_dicom.Enable(False)
111 self._BTN_save_studies_as_dicom_dir.SetToolTip(_("Save selected studies to disk as DICOM directory."))
112 self._BTN_save_studies_as_dicom_dir.Enable(False)
113 self._BTN_save_patient_as_dicom_dir.SetToolTip(_("Save all studies as one DICOM directory."))
114 self._BTN_save_patient_as_dicom_dir.Enable(False)
115 self._BTN_upload.SetToolTip(_("Upload DICOM files from a directory, recursively, into the Orthanc PACS\n\nThe currently active patient does not matter. Orthanc will associate uploaded files with the patient found within the DICOM metadata. It will create new patients as needed."))
116 self._BTN_upload.Enable(False)
117 self._BTN_image_show.SetToolTip(_("Show image in external viewer (PNG format)."))
118 self._BTN_image_show.Enable(False)
119 self._BTN_save_image_preview.SetToolTip(_("Save image preview (PNG format)."))
120 self._BTN_save_image_preview.Enable(False)
121 self._BTN_save_studies_as_zip.SetToolTip(_("Save selected studies as DICOM archive."))
122 self._BTN_save_studies_as_zip.Enable(False)
123 self._BTN_save_patient_as_zip.SetToolTip(_("Save all studies of patient as DICOM archive."))
124 self._BTN_save_patient_as_zip.Enable(False)
125 self._BTN_modify_orthanc_content.SetToolTip(_("Modify some of Orthanc content (such as patient IDs)."))
126 self._BTN_modify_orthanc_content.Enable(False)
127
128
130
131 __szr_main = wx.BoxSizer(wx.VERTICAL)
132 __szr_details = wx.BoxSizer(wx.HORIZONTAL)
133 __szr_metadata_image = wx.BoxSizer(wx.VERTICAL)
134 __szr_images_buttons = wx.BoxSizer(wx.HORIZONTAL)
135 __gszr_buttons_bottom = wx.FlexGridSizer(4, 5, 1, 4)
136 __szr_prev_next = wx.BoxSizer(wx.HORIZONTAL)
137 __szr_studies_series = wx.BoxSizer(wx.VERTICAL)
138 __szr_PACS_details = wx.BoxSizer(wx.HORIZONTAL)
139 __szr_PACS_details.Add(self.__lbl_host, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
140 __szr_PACS_details.Add(self._TCTRL_host, 1, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
141 __szr_PACS_details.Add(self.__lbl_port, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
142 __szr_PACS_details.Add(self._TCTRL_port, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
143 __szr_PACS_details.Add(self.__lbl_user, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
144 __szr_PACS_details.Add(self._TCTRL_user, 1, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
145 __szr_PACS_details.Add(self.__lbl_password, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3)
146 __szr_PACS_details.Add(self._TCTRL_password, 1, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
147 __szr_PACS_details.Add(self._BTN_connect, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5)
148 __szr_main.Add(__szr_PACS_details, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3)
149 __szr_main.Add(self._LBL_PACS_identification, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3)
150 __szr_studies_series.Add(self._LBL_patient_identification, 0, wx.ALL | wx.EXPAND, 3)
151 __szr_studies_series.Add(self._LCTRL_studies, 3, wx.EXPAND | wx.TOP, 3)
152 __szr_studies_series.Add(self._LCTRL_series, 2, wx.EXPAND | wx.TOP, 3)
153 __szr_details.Add(__szr_studies_series, 1, wx.EXPAND | wx.RIGHT, 3)
154 __szr_metadata_image.Add(self._LCTRL_details, 1, wx.EXPAND, 0)
155 __szr_metadata_image.Add(self._TCTRL_details, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
156 __szr_images_buttons.Add(self._BMP_preview, 0, wx.ALL, 2)
157 __gszr_buttons_bottom.Add(self._LBL_image, 0, wx.ALIGN_CENTER, 0)
158 __gszr_buttons_bottom.Add((20, 20), 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0)
159 __lbl_study = wx.StaticText(self, wx.ID_ANY, _("Study"))
160 __gszr_buttons_bottom.Add(__lbl_study, 0, wx.ALIGN_CENTER, 0)
161 __gszr_buttons_bottom.Add(self._BTN_verify_patient_data, 0, wx.ALIGN_CENTER, 0)
162 __lbl_PACS = wx.StaticText(self, wx.ID_ANY, _("PACS"))
163 __gszr_buttons_bottom.Add(__lbl_PACS, 0, wx.ALIGN_CENTER, 0)
164 __szr_prev_next.Add(self._BTN_previous_image, 0, wx.ALIGN_CENTER | wx.ALL, 3)
165 __szr_prev_next.Add(self._BTN_next_image, 0, wx.ALIGN_CENTER | wx.ALL, 3)
166 __gszr_buttons_bottom.Add(__szr_prev_next, 0, wx.ALIGN_CENTER, 0)
167 __gszr_buttons_bottom.Add(self._BTN_image_export, 0, wx.ALIGN_CENTER, 0)
168 __gszr_buttons_bottom.Add(self._BTN_browse_study, 0, wx.ALIGN_CENTER | wx.ALL, 3)
169 __gszr_buttons_bottom.Add(self._BTN_browse_patient, 0, wx.ALIGN_CENTER | wx.ALL, 3)
170 __gszr_buttons_bottom.Add(self._BTN_browse_pacs, 0, wx.ALIGN_CENTER | wx.ALL, 5)
171 __gszr_buttons_bottom.Add(self._BTN_image_show_dicom, 0, wx.ALIGN_CENTER, 0)
172 __gszr_buttons_bottom.Add(self._BTN_save_image_as_dicom, 0, wx.ALIGN_CENTER, 0)
173 __gszr_buttons_bottom.Add(self._BTN_save_studies_as_dicom_dir, 0, wx.ALIGN_CENTER | wx.RIGHT, 3)
174 __gszr_buttons_bottom.Add(self._BTN_save_patient_as_dicom_dir, 0, wx.ALIGN_CENTER | wx.RIGHT, 3)
175 __gszr_buttons_bottom.Add(self._BTN_upload, 0, wx.ALIGN_CENTER, 0)
176 __gszr_buttons_bottom.Add(self._BTN_image_show, 0, wx.ALIGN_CENTER, 0)
177 __gszr_buttons_bottom.Add(self._BTN_save_image_preview, 0, wx.ALIGN_CENTER, 0)
178 __gszr_buttons_bottom.Add(self._BTN_save_studies_as_zip, 0, wx.ALIGN_CENTER, 0)
179 __gszr_buttons_bottom.Add(self._BTN_save_patient_as_zip, 0, wx.ALIGN_CENTER, 0)
180 __gszr_buttons_bottom.Add(self._BTN_modify_orthanc_content, 0, wx.ALIGN_CENTER, 0)
181 __szr_images_buttons.Add(__gszr_buttons_bottom, 0, wx.EXPAND, 0)
182 __szr_metadata_image.Add(__szr_images_buttons, 0, wx.EXPAND, 0)
183 __szr_details.Add(__szr_metadata_image, 1, wx.EXPAND, 0)
184 __szr_main.Add(__szr_details, 1, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3)
185 self.SetSizer(__szr_main)
186 __szr_main.Fit(self)
187 self.Layout()
188
189
191 print("Event handler '_on_connect_button_pressed' not implemented!")
192 event.Skip()
193
195 print("Event handler '_on_verify_patient_data_button_pressed' not implemented!")
196 event.Skip()
197
199 print("Event handler '_on_previous_image_button_pressed' not implemented!")
200 event.Skip()
201
203 print("Event handler '_on_next_image_button_pressed' not implemented!")
204 event.Skip()
205
207 print("Event handler '_on_button_image_export_pressed' not implemented!")
208 event.Skip()
209
211 print("Event handler '_on_browse_study_button_pressed' not implemented!")
212 event.Skip()
213
215 print("Event handler '_on_browse_patient_button_pressed' not implemented!")
216 event.Skip()
217
219 print("Event handler '_on_browse_pacs_button_pressed' not implemented!")
220 event.Skip()
221
223 print("Event handler '_on_button_image_show_dicom_pressed' not implemented!")
224 event.Skip()
225
227 print("Event handler '_on_save_image_as_dicom_button_pressed' not implemented!")
228 event.Skip()
229
231 print("Event handler '_on_save_studies_as_dicom_dir_button_pressed' not implemented!")
232 event.Skip()
233
235 print("Event handler '_on_save_patient_as_dicom_dir_button_pressed' not implemented!")
236 event.Skip()
237
239 print("Event handler '_on_upload_button_pressed' not implemented!")
240 event.Skip()
241
243 print("Event handler '_on_button_image_show_pressed' not implemented!")
244 event.Skip()
245
247 print("Event handler '_on_save_image_preview_button_pressed' not implemented!")
248 event.Skip()
249
251 print("Event handler '_on_save_studies_as_zip_button_pressed' not implemented!")
252 event.Skip()
253
255 print("Event handler '_on_save_patient_as_zip_button_pressed' not implemented!")
256 event.Skip()
257
259 print("Event handler '_on_modify_orthanc_content_button_pressed' not implemented!")
260 event.Skip()
261
262
263