Package Gnumed :: Package wxGladeWidgets :: Module wxgPACSPluginPnl
[frames] | no frames]

Source Code for Module Gnumed.wxGladeWidgets.wxgPACSPluginPnl

  1  # -*- coding: UTF-8 -*- 
  2  # 
  3  # generated by wxGlade 
  4  # 
  5   
  6  import wx 
  7   
  8  # begin wxGlade: dependencies 
  9  import gettext 
 10  # end wxGlade 
 11   
 12  # begin wxGlade: extracode 
 13  from Gnumed.wxpython.gmListWidgets import cReportListCtrl 
 14  from Gnumed.wxpython.gmTextCtrl import cTextCtrl 
 15  # end wxGlade 
 16   
 17   
18 -class wxgPACSPluginPnl(wx.Panel):
19 - def __init__(self, *args, **kwds):
20 # begin wxGlade: wxgPACSPluginPnl.__init__ 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 # end wxGlade 80
81 - def __set_properties(self):
82 # begin wxGlade: wxgPACSPluginPnl.__set_properties 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.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND)) 89 self._LCTRL_details.SetFont(wx.Font(9, wx.MODERN, wx.NORMAL, wx.NORMAL, 0, "")) 90 self._TCTRL_details.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_BACKGROUND)) 91 self._TCTRL_details.SetFont(wx.Font(9, wx.MODERN, wx.NORMAL, wx.NORMAL, 0, "")) 92 self._TCTRL_details.Hide() 93 self._BMP_preview.SetMinSize((50, 50)) 94 self._BTN_verify_patient_data.SetToolTip(_("Verify patient data in PACS.")) 95 self._BTN_verify_patient_data.Enable(False) 96 self._BTN_previous_image.SetToolTip(_("Review previous image.")) 97 self._BTN_previous_image.Enable(False) 98 self._BTN_next_image.SetToolTip(_("Preview next image.")) 99 self._BTN_next_image.Enable(False) 100 self._BTN_image_export.SetToolTip(_("Store image into export area.")) 101 self._BTN_image_export.Enable(False) 102 self._BTN_browse_study.SetToolTip(_("Browse topmost selected study.")) 103 self._BTN_browse_study.Enable(False) 104 self._BTN_browse_patient.SetToolTip(_("Browse overview of all studies for this patient.")) 105 self._BTN_browse_patient.Enable(False) 106 self._BTN_browse_pacs.SetToolTip(_("Browse PACS at top level.")) 107 self._BTN_browse_pacs.Enable(False) 108 self._BTN_image_show_dicom.SetToolTip(_("Show image in DICOM viewer.")) 109 self._BTN_image_show_dicom.Enable(False) 110 self._BTN_save_image_as_dicom.SetToolTip(_("Save image in DICOM format.")) 111 self._BTN_save_image_as_dicom.Enable(False) 112 self._BTN_save_studies_as_dicom_dir.SetToolTip(_("Save selected studies to disk as DICOM directory.")) 113 self._BTN_save_studies_as_dicom_dir.Enable(False) 114 self._BTN_save_patient_as_dicom_dir.SetToolTip(_("Save all studies as one DICOM directory.")) 115 self._BTN_save_patient_as_dicom_dir.Enable(False) 116 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.")) 117 self._BTN_upload.Enable(False) 118 self._BTN_image_show.SetToolTip(_("Show image in external viewer (PNG format).")) 119 self._BTN_image_show.Enable(False) 120 self._BTN_save_image_preview.SetToolTip(_("Save image preview (PNG format).")) 121 self._BTN_save_image_preview.Enable(False) 122 self._BTN_save_studies_as_zip.SetToolTip(_("Save selected studies as DICOM archive.")) 123 self._BTN_save_studies_as_zip.Enable(False) 124 self._BTN_save_patient_as_zip.SetToolTip(_("Save all studies of patient as DICOM archive.")) 125 self._BTN_save_patient_as_zip.Enable(False) 126 self._BTN_modify_orthanc_content.SetToolTip(_("Modify some of Orthanc content (such as patient IDs).")) 127 self._BTN_modify_orthanc_content.Enable(False)
128 # end wxGlade 129
130 - def __do_layout(self):
131 # begin wxGlade: wxgPACSPluginPnl.__do_layout 132 __szr_main = wx.BoxSizer(wx.VERTICAL) 133 __szr_details = wx.BoxSizer(wx.HORIZONTAL) 134 __szr_metadata_image = wx.BoxSizer(wx.VERTICAL) 135 __szr_images_buttons = wx.BoxSizer(wx.HORIZONTAL) 136 __gszr_buttons_bottom = wx.FlexGridSizer(4, 5, 1, 4) 137 __szr_prev_next = wx.BoxSizer(wx.HORIZONTAL) 138 __szr_studies_series = wx.BoxSizer(wx.VERTICAL) 139 __szr_PACS_details = wx.BoxSizer(wx.HORIZONTAL) 140 __szr_PACS_details.Add(self.__lbl_host, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3) 141 __szr_PACS_details.Add(self._TCTRL_host, 1, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5) 142 __szr_PACS_details.Add(self.__lbl_port, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3) 143 __szr_PACS_details.Add(self._TCTRL_port, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5) 144 __szr_PACS_details.Add(self.__lbl_user, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3) 145 __szr_PACS_details.Add(self._TCTRL_user, 1, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5) 146 __szr_PACS_details.Add(self.__lbl_password, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 3) 147 __szr_PACS_details.Add(self._TCTRL_password, 1, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5) 148 __szr_PACS_details.Add(self._BTN_connect, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 5) 149 __szr_main.Add(__szr_PACS_details, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3) 150 __szr_main.Add(self._LBL_PACS_identification, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3) 151 __szr_studies_series.Add(self._LBL_patient_identification, 0, wx.ALL | wx.EXPAND, 3) 152 __szr_studies_series.Add(self._LCTRL_studies, 3, wx.ALL | wx.EXPAND, 3) 153 __szr_studies_series.Add(self._LCTRL_series, 2, wx.EXPAND | wx.TOP, 3) 154 __szr_details.Add(__szr_studies_series, 1, wx.EXPAND | wx.RIGHT, 5) 155 __szr_metadata_image.Add(self._LCTRL_details, 1, wx.EXPAND, 0) 156 __szr_metadata_image.Add(self._TCTRL_details, 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0) 157 __szr_images_buttons.Add(self._BMP_preview, 0, wx.ALL, 2) 158 __gszr_buttons_bottom.Add(self._LBL_image, 0, wx.ALIGN_CENTER, 0) 159 __gszr_buttons_bottom.Add((20, 20), 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0) 160 __lbl_study = wx.StaticText(self, wx.ID_ANY, _("Study")) 161 __gszr_buttons_bottom.Add(__lbl_study, 0, wx.ALIGN_CENTER, 0) 162 __gszr_buttons_bottom.Add(self._BTN_verify_patient_data, 0, wx.ALIGN_CENTER, 0) 163 __lbl_PACS = wx.StaticText(self, wx.ID_ANY, _("PACS")) 164 __gszr_buttons_bottom.Add(__lbl_PACS, 0, wx.ALIGN_CENTER, 0) 165 __szr_prev_next.Add(self._BTN_previous_image, 0, wx.ALIGN_CENTER | wx.ALL, 3) 166 __szr_prev_next.Add(self._BTN_next_image, 0, wx.ALIGN_CENTER | wx.ALL, 3) 167 __gszr_buttons_bottom.Add(__szr_prev_next, 0, wx.ALIGN_CENTER, 0) 168 __gszr_buttons_bottom.Add(self._BTN_image_export, 0, wx.ALIGN_CENTER, 0) 169 __gszr_buttons_bottom.Add(self._BTN_browse_study, 0, wx.ALIGN_CENTER | wx.ALL, 3) 170 __gszr_buttons_bottom.Add(self._BTN_browse_patient, 0, wx.ALIGN_CENTER | wx.ALL, 3) 171 __gszr_buttons_bottom.Add(self._BTN_browse_pacs, 0, wx.ALIGN_CENTER | wx.ALL, 5) 172 __gszr_buttons_bottom.Add(self._BTN_image_show_dicom, 0, wx.ALIGN_CENTER, 0) 173 __gszr_buttons_bottom.Add(self._BTN_save_image_as_dicom, 0, wx.ALIGN_CENTER, 0) 174 __gszr_buttons_bottom.Add(self._BTN_save_studies_as_dicom_dir, 0, wx.ALIGN_CENTER | wx.RIGHT, 3) 175 __gszr_buttons_bottom.Add(self._BTN_save_patient_as_dicom_dir, 0, wx.ALIGN_CENTER | wx.RIGHT, 3) 176 __gszr_buttons_bottom.Add(self._BTN_upload, 0, wx.ALIGN_CENTER, 0) 177 __gszr_buttons_bottom.Add(self._BTN_image_show, 0, wx.ALIGN_CENTER, 0) 178 __gszr_buttons_bottom.Add(self._BTN_save_image_preview, 0, wx.ALIGN_CENTER, 0) 179 __gszr_buttons_bottom.Add(self._BTN_save_studies_as_zip, 0, wx.ALIGN_CENTER, 0) 180 __gszr_buttons_bottom.Add(self._BTN_save_patient_as_zip, 0, wx.ALIGN_CENTER, 0) 181 __gszr_buttons_bottom.Add(self._BTN_modify_orthanc_content, 0, wx.ALIGN_CENTER, 0) 182 __szr_images_buttons.Add(__gszr_buttons_bottom, 0, wx.EXPAND, 0) 183 __szr_images_buttons.Add((0, 0), 0, 0, 0) 184 __szr_metadata_image.Add(__szr_images_buttons, 0, wx.EXPAND, 0) 185 __szr_details.Add(__szr_metadata_image, 1, wx.EXPAND, 0) 186 __szr_main.Add(__szr_details, 1, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 3) 187 self.SetSizer(__szr_main) 188 __szr_main.Fit(self) 189 self.Layout()
190 # end wxGlade 191
192 - def _on_connect_button_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
193 print("Event handler '_on_connect_button_pressed' not implemented!") 194 event.Skip()
195
196 - def _on_verify_patient_data_button_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
197 print("Event handler '_on_verify_patient_data_button_pressed' not implemented!") 198 event.Skip() 199
200 - def _on_previous_image_button_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
201 print("Event handler '_on_previous_image_button_pressed' not implemented!") 202 event.Skip() 203
204 - def _on_next_image_button_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
205 print("Event handler '_on_next_image_button_pressed' not implemented!") 206 event.Skip() 207
208 - def _on_button_image_export_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
209 print("Event handler '_on_button_image_export_pressed' not implemented!") 210 event.Skip() 211
212 - def _on_browse_study_button_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
213 print("Event handler '_on_browse_study_button_pressed' not implemented!") 214 event.Skip() 215
216 - def _on_browse_patient_button_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
217 print("Event handler '_on_browse_patient_button_pressed' not implemented!") 218 event.Skip() 219
220 - def _on_browse_pacs_button_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
221 print("Event handler '_on_browse_pacs_button_pressed' not implemented!") 222 event.Skip() 223
224 - def _on_button_image_show_dicom_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
225 print("Event handler '_on_button_image_show_dicom_pressed' not implemented!") 226 event.Skip() 227
228 - def _on_save_image_as_dicom_button_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
229 print("Event handler '_on_save_image_as_dicom_button_pressed' not implemented!") 230 event.Skip() 231
232 - def _on_save_studies_as_dicom_dir_button_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
233 print("Event handler '_on_save_studies_as_dicom_dir_button_pressed' not implemented!") 234 event.Skip() 235
236 - def _on_save_patient_as_dicom_dir_button_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
237 print("Event handler '_on_save_patient_as_dicom_dir_button_pressed' not implemented!") 238 event.Skip() 239
240 - def _on_upload_button_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
241 print("Event handler '_on_upload_button_pressed' not implemented!") 242 event.Skip() 243
244 - def _on_button_image_show_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
245 print("Event handler '_on_button_image_show_pressed' not implemented!") 246 event.Skip() 247
248 - def _on_save_image_preview_button_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
249 print("Event handler '_on_save_image_preview_button_pressed' not implemented!") 250 event.Skip() 251
252 - def _on_save_studies_as_zip_button_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
253 print("Event handler '_on_save_studies_as_zip_button_pressed' not implemented!") 254 event.Skip() 255
256 - def _on_save_patient_as_zip_button_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
257 print("Event handler '_on_save_patient_as_zip_button_pressed' not implemented!") 258 event.Skip() 259
260 - def _on_modify_orthanc_content_button_pressed(self, event): # wxGlade: wxgPACSPluginPnl.<event_handler>
261 print("Event handler '_on_modify_orthanc_content_button_pressed' not implemented!") 262 event.Skip() 263 264 # end of class wxgPACSPluginPnl 265