-
Notifications
You must be signed in to change notification settings - Fork 2
/
ORL_launcher_window.py
645 lines (532 loc) · 25.6 KB
/
ORL_launcher_window.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
# -*- coding: utf-8 -*-
import sys
import os.path
import setpath
import hmrlib.lib as lib
import hmrlib.eval as eval
import hmrlib.optim as optim
import hmrlib.poi as poi
import hmrlib.roi as roi
import hmrlib.qa as qa
import hmrlib.uis as uis
import beams
import optimization_objectives
import clinical_goals
import logging
from hmrlib.HMR_RS_LoggerAdapter import HMR_RS_LoggerAdapter
# To test GUI stuff
import clr
import System.Array
import verification
import report
import statistics
import message
import orl
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
from System.Drawing import Color, Font, FontStyle, Point, Size
from System.Windows.Forms import (Application, BorderStyle, Button, CheckBox, Form, Label, Panel, RadioButton, ComboBox, TextBox)
def ORL_launcher():
class ScriptLauncher(Form):
def __init__(self):
self.Text = "ORL Script Launcher"
self.Width = 750
self.Height = 780
self.setupPlanningScriptLauncher()
self.setupOKButtons()
self.setupMachineSelectPanel()
self.Controls.Add(self.LauncherPanel)
self.Controls.Add(self.OKbuttonPanel)
self.Controls.Add(self.MachineSelectPanel)
def newPanel(self, x, y):
panel = Panel()
panel.Width = 750
panel.Height = 450
panel.Location = Point(x, y)
panel.BorderStyle = BorderStyle.None
return panel
def miniPanel(self, x, y):
panel = Panel()
panel.Width = 750
panel.Height = 130
panel.Location = Point(x, y)
panel.BorderStyle = BorderStyle.None
return panel
def setupPlanningScriptLauncher(self):
self.LauncherPanel = self.newPanel(0, 0)
self.PatientLabel = Label()
self.PatientLabel.Text = "Patient: " + patient.PatientName.replace('^', ', ')
self.PatientLabel.Location = Point(25, 25)
self.PatientLabel.Font = Font("Arial", 10, FontStyle.Bold)
self.PatientLabel.AutoSize = True
self.Label2 = Label()
self.Label2.Text = ""
self.Label2.Location = Point(300, 50)
self.Label2.AutoSize = True
self.Label2.Font = Font("Arial", 10)
self.Label2.ForeColor = Color.Black
self.Label3 = Label()
self.Label3.Text = ""
self.Label3.Location = Point(300, 70)
self.Label3.AutoSize = True
self.Label3.Font = Font("Arial", 10)
self.Label3.ForeColor = Color.Black
self.Label4 = Label()
self.Label4.Text = ""
self.Label4.Location = Point(300, 90)
self.Label4.AutoSize = True
self.Label4.Font = Font("Arial", 10)
self.Label4.ForeColor = Color.Black
self.Label5 = Label()
self.Label5.Text = ""
self.Label5.Location = Point(300, 110)
self.Label5.AutoSize = True
self.Label5.Font = Font("Arial", 10)
self.Label5.ForeColor = Color.Black
self.Reminder = Label()
self.Reminder.Text = ""
self.Reminder.Location = Point(300, 220)
self.Reminder.AutoSize = True
self.Reminder.Font = Font("Arial", 11, FontStyle.Italic)
self.Reminder.ForeColor = Color.Black
self.PTV1Label = Label()
self.PTV1Label.Text = "PTV 1 (+haut):"
self.PTV1Label.Location = Point(25, 60)
self.PTV1Label.Font = Font("Arial", 10)
self.PTV1Label.AutoSize = True
self.PTV1name = TextBox()
self.PTV1name.Text = " "
self.PTV1name.Size = Size(60,60)
self.PTV1name.Location = Point(120,60)
self.dose1Label = Label()
self.dose1Label.Text = "dose:"
self.dose1Label.Location = Point(200, 60)
self.dose1Label.Font = Font("Arial", 10)
self.dose1Label.AutoSize = True
self.PTV1dose = TextBox()
self.PTV1dose.Text = " "
self.PTV1dose.Size = Size(40,30)
self.PTV1dose.Location = Point(260,60)
self.fractionLabel = Label()
self.fractionLabel.Text = "nbr fraction:"
self.fractionLabel.Location = Point(320, 60)
self.fractionLabel.Font = Font("Arial", 10)
self.fractionLabel.AutoSize = True
self.fraction = TextBox()
self.fraction.Text = " "
self.fraction.Size = Size(40,30)
self.fraction.Location = Point(430,60)
self.PTV2Label = Label()
self.PTV2Label.Text = "PTV 2:"
self.PTV2Label.Location = Point(25, 90)
self.PTV2Label.Font = Font("Arial", 10)
self.PTV2Label.AutoSize = True
self.PTV2name = TextBox()
self.PTV2name.Text = " "
self.PTV2name.Size = Size(60,60)
self.PTV2name.Location = Point(120,90)
self.dose2Label = Label()
self.dose2Label.Text = "dose:"
self.dose2Label.Location = Point(200, 90)
self.dose2Label.Font = Font("Arial", 10)
self.dose2Label.AutoSize = True
self.PTV2dose = TextBox()
self.PTV2dose.Text = " "
self.PTV2dose.Size = Size(40,30)
self.PTV2dose.Location = Point(260,90)
self.champLabel = Label()
self.champLabel.Text = "nbr champs/arcs:"
self.champLabel.Location = Point(320, 90)
self.champLabel.Font = Font("Arial", 10)
self.champLabel.AutoSize = True
self.champ = TextBox()
self.champ.Text = " "
self.champ.Size = Size(40,30)
self.champ.Location = Point(430,90)
self.PTV3Label = Label()
self.PTV3Label.Text = "PTV 3:"
self.PTV3Label.Location = Point(25, 120)
self.PTV3Label.Font = Font("Arial", 10)
self.PTV3Label.AutoSize = True
self.PTV3name = TextBox()
self.PTV3name.Text = " "
self.PTV3name.Size = Size(60,60)
self.PTV3name.Location = Point(120,120)
self.dose3Label = Label()
self.dose3Label.Text = "dose:"
self.dose3Label.Location = Point(200, 120)
self.dose3Label.Font = Font("Arial", 10)
self.dose3Label.AutoSize = True
self.PTV3dose = TextBox()
self.PTV3dose.Text = " "
self.PTV3dose.Size = Size(40,30)
self.PTV3dose.Location = Point(260,120)
self.avertissement = Label()
self.avertissement.Text = "(2 arcs maximum):"
self.avertissement.Location = Point(320, 110)
self.avertissement.Font = Font("Arial", 8)
self.avertissement.AutoSize = True
self.PTV4Label = Label()
self.PTV4Label.Text = "PTV 4:"
self.PTV4Label.Location = Point(25, 150)
self.PTV4Label.Font = Font("Arial", 10)
self.PTV4Label.AutoSize = True
self.PTV4name = TextBox()
self.PTV4name.Text = " "
self.PTV4name.Size = Size(60,60)
self.PTV4name.Location = Point(120,150)
self.dose4Label = Label()
self.dose4Label.Text = "dose:"
self.dose4Label.Location = Point(200, 150)
self.dose4Label.Font = Font("Arial", 10)
self.dose4Label.AutoSize = True
self.PTV4dose = TextBox()
self.PTV4dose.Text = " "
self.PTV4dose.Size = Size(40,30)
self.PTV4dose.Location = Point(260,150)
self.techniqueLabel = Label()
self.techniqueLabel.Text = "Technique:"
self.techniqueLabel.Location = Point(25, 180)
self.techniqueLabel.Font = Font("Arial", 10)
self.techniqueLabel.AutoSize = True
self.techniquecombo = ComboBox()
self.techniquecombo.Parent = self
self.techniquecombo.Size = Size(55,40)
self.techniquecombo.Location = Point(135, 180)
self.techniquecombo.Items.Add("IMRT")
self.techniquecombo.Items.Add("VMAT")
self.techniquecombo.Text = 'IMRT'
self.SiteLabel = Label()
self.SiteLabel.Text = "Nom du site:"
self.SiteLabel.Location = Point(25, 210)
self.SiteLabel.Font = Font("Arial", 10)
self.SiteLabel.AutoSize = True
self.SiteBox = TextBox()
self.SiteBox.Text = "A1"
self.SiteBox.Location = Point(135, 210)
self.SiteBox.Width = 40
self.scanLabel = Label()
self.scanLabel.Text = "Scan de planif"
self.scanLabel.Location = Point(25, 240)
self.scanLabel.Font = Font("Arial", 10)
self.scanLabel.AutoSize = True
self.scancombo = ComboBox()
self.scancombo.Parent = self
self.scancombo.Size = Size(55,40)
self.scancombo.Location = Point(135, 240)
self.scancombo.Text = 'Choissisez'
self.OptionsLabel = Label()
self.OptionsLabel.Text = "Options:"
self.OptionsLabel.Location = Point(25, 300)
self.OptionsLabel.Font = Font("Arial", 10)
self.OptionsLabel.AutoSize = True
self.check1 = CheckBox()
self.check1.Text = "Double optimization initiale + extra?"
self.check1.Location = Point(40, 330)
self.check1.Width = 300
self.check1.Checked = False
self.check3 = CheckBox()
self.check3.Text = "Inclure structures optiques?"
self.check3.Location = Point(40, 360)
self.check3.Width = 300
self.check3.Checked = False
self.check2 = CheckBox()
self.check2.Text = "Adapter dose color table?"
self.check2.Location = Point(40, 390)
self.check2.Width = 300
self.check2.Checked = True
self.Entete = Label()
self.Entete.Text = ""
self.Entete.Location = Point(300, 25)
self.Entete.AutoSize = True
self.Entete.Font = Font("Arial", 12, FontStyle.Bold)
self.Entete.ForeColor = Color.Black
self.LauncherPanel.Controls.Add(self.PatientLabel)
self.LauncherPanel.Controls.Add(self.Label2)
self.LauncherPanel.Controls.Add(self.Label3)
self.LauncherPanel.Controls.Add(self.Label4)
self.LauncherPanel.Controls.Add(self.Label5)
self.LauncherPanel.Controls.Add(self.Entete)
self.LauncherPanel.Controls.Add(self.Reminder)
#self.LauncherPanel.Controls.Add(self.RxLabel)
self.LauncherPanel.Controls.Add(self.PTV1Label)
self.LauncherPanel.Controls.Add(self.PTV1name)
self.LauncherPanel.Controls.Add(self.dose1Label)
self.LauncherPanel.Controls.Add(self.PTV1dose)
self.LauncherPanel.Controls.Add(self.PTV2Label)
self.LauncherPanel.Controls.Add(self.PTV2name)
self.LauncherPanel.Controls.Add(self.dose2Label)
self.LauncherPanel.Controls.Add(self.PTV2dose)
self.LauncherPanel.Controls.Add(self.PTV3Label)
self.LauncherPanel.Controls.Add(self.PTV3name)
self.LauncherPanel.Controls.Add(self.dose3Label)
self.LauncherPanel.Controls.Add(self.PTV3dose)
self.LauncherPanel.Controls.Add(self.PTV4Label)
self.LauncherPanel.Controls.Add(self.PTV4name)
self.LauncherPanel.Controls.Add(self.dose4Label)
self.LauncherPanel.Controls.Add(self.PTV4dose)
self.LauncherPanel.Controls.Add(self.fractionLabel)
self.LauncherPanel.Controls.Add(self.fraction)
#self.LauncherPanel.Controls.Add(self.isodoseLabel)
self.LauncherPanel.Controls.Add(self.scanLabel)
self.LauncherPanel.Controls.Add(self.techniqueLabel)
self.LauncherPanel.Controls.Add(self.champLabel)
self.LauncherPanel.Controls.Add(self.champ)
self.LauncherPanel.Controls.Add(self.avertissement)
self.LauncherPanel.Controls.Add(self.SiteLabel)
self.LauncherPanel.Controls.Add(self.SiteBox)
self.LauncherPanel.Controls.Add(self.OptionsLabel)
self.LauncherPanel.Controls.Add(self.check1)
self.LauncherPanel.Controls.Add(self.check2)
self.LauncherPanel.Controls.Add(self.check3)
#self.LauncherPanel.Controls.Add(self.check3)
exam_list = []
for CT in patient.Examinations:
exam_list.append(CT.Name)
for contour in patient.PatientModel.RegionsOfInterest:
if not roi.get_roi_approval(contour.Name,patient.Examinations["CT 1"]):
VolCT1 = roi.get_roi_volume(contour.Name, exam=patient.Examinations["CT 1"])
if "CT 2" in exam_list:
VolCT2 = roi.get_roi_volume(contour.Name, exam=patient.Examinations["CT 2"])
else:
VolCT2 = 0
if VolCT1 == 0 and VolCT2 == 0:
contour.Name = ("vide_" + contour.Name)
self.trouvePTV()
def trouvePTV(self):
# Erase error messages and clear prescription selection menu
self.Label2.Text = ""
self.Label3.Text = ""
self.Label4.Text = ""
self.Label5.Text = ""
#self.Entete.Text = "test DM"
self.Reminder.Text = ""
self.Label2.ForeColor = Color.Black
self.Label3.ForeColor = Color.Black
self.Label4.ForeColor = Color.Black
self.Label5.ForeColor = Color.Black
#self.Entete.ForeColor = Color.Black
#self.Reminder.ForeColor = Color.Black
#self.check1.Text = "Double optimization initiale + extra?"
#self.check1.Checked = False
#self.check2.Text = ""
#self.check2.Checked = False
#self.check3.Text = ""
#self.check3.Checked = False
#self.comboBoxRx.Items.Clear()
#self.comboBoxRx.Text = "-----"
#self.techniquecombo.Items.Clear()
#self.techniquecombo.Items.Add("VMAT")
#self.techniquecombo.Text = 'VMAT'
PACE = False
roi_names = [x.Name for x in patient.PatientModel.RegionsOfInterest]
ptv_name_list = []
presc_dose_list = []
for name in roi_names:
n = name.replace(' ', '').upper()
debut = name[0:3]
if debut == 'PTV':
try:
presc_dose = float(name[3:])
except IndexError:
continue
except ValueError:
continue
ptv_name_list.append(name)
presc_dose_list.append(presc_dose)
ptv_name_list.sort(reverse=True)
presc_dose_list.sort(reverse=True)
if len(ptv_name_list) == 0:
self.Label2.Text = "Attention: Aucun PTV trouvé!"
self.Label2.ForeColor = Color.Red
else:
self.PTV1name.Text = ptv_name_list[0]
self.PTV1dose.Text = '%.2f'%presc_dose_list[0]
try:
self.PTV2name.Text = ptv_name_list[1]
self.PTV2dose.Text = '%.2f'%presc_dose_list[1]
except IndexError:
pass
try:
self.PTV3name.Text = ptv_name_list[2]
self.PTV3dose.Text = '%.2f'%presc_dose_list[2]
except IndexError:
pass
try:
self.PTV4name.Text = ptv_name_list[3]
self.PTV4dose.Text = '%.2f'%presc_dose_list[3]
except IndexError:
pass
def okClicked(self, sender, args):
#Prevent users from creating a new plan twice in a row
if self.Status.Text == "Script terminé! Cliquez sur Cancel pour sortir.":
return
#Check to see which machine is selected for treatment
if self.BeamModButton.Checked:
machine = 'BeamMod'
elif self.InfinityButton.Checked:
machine = 'Infinity'
else:
self.Status.Text = "Il faut choisir un appareil avant de continuer"
self.Status.ForeColor = Color.Red
return
#Check treatment techniqueLabel and nbr of field
if self.techniquecombo.Text == 'IMRT':
treatment_technique = 'SMLC'
beamset_name = 'ORL IMRT'
else:
treatment_technique = 'VMAT'
beamset_name = 'ORL VMAT'
#Determine prescription dose (in Gy) and number of fractions
rx_dose = []
ptv = []
try:
rx_dose_PTV1 = int(float(self.PTV1dose.Text)*100)
rx_dose.append(rx_dose_PTV1)
ptv.append(self.PTV1name.Text)
except ValueError:
pass
try:
rx_dose_PTV2 = int(float(self.PTV2dose.Text)*100)
rx_dose.append(rx_dose_PTV2)
ptv.append(self.PTV2name.Text)
except ValueError:
pass
try:
rx_dose_PTV3 = int(float(self.PTV3dose.Text)*100)
rx_dose.append(rx_dose_PTV3)
ptv.append(self.PTV3name.Text)
except ValueError:
pass
try:
rx_dose_PTV4 = int(float(self.PTV4dose.Text)*100)
rx_dose.append(rx_dose_PTV4)
ptv.append(self.PTV4name.Text)
except ValueError:
pass
try:
nb_fx = int(self.fraction.Text)
except ValueError:
self.Status.Text = "Impossible de lire le nombre de fractions"
self.Status.ForeColor = Color.Red
try:
nb_ch = int(self.champ.Text)
except ValueError:
self.Status.Text = "Impossible de lire le nombre de champ"
self.Status.ForeColor = Color.Red
#Create the plan data dictionary to send to the component scripts
#d = {'plan_name':'A1'}
d = dict(patient = patient,
plan_name = beamset_name,
beamset_name = beamset_name,
site_name = self.SiteBox.Text,
exam = patient.Examinations[self.scancombo.Text],
ct = self.scancombo.Text,
machine = machine,
nb_fx = nb_fx,
nb_ch = nb_ch,
rx_dose = rx_dose,
ptv = ptv,
treatment_technique = treatment_technique)
self.Status.ForeColor = Color.Black
if patient.BodySite == '':
patient.BodySite = 'ORL'
#POIS assignation, ROIS creation, plan and beamset adding
self.Status.Text = "En cours: Gestion des POIs"
orl.orl_pois(plan_data = d)
self.Status.Text = "En cours: Création des ROIs (peut prendre un peu de temps)"
orl.orl_rois(plan_data = d)
self.Status.Text = "En cours: Ajout du plan et beamset"
orl.orl_add_plan_and_beamset(plan_data = d)
#dose color table adjustment if selected
if self.check2.Checked:
self.Status.Text = "En cours: Reglage du Dose Color Table"
orl.orl_create_isodose_lines(plan_data = d)
#add beams or arcs
self.Status.Text = "En cours: Ajout des faisceaux"
orl.orl_add_beams(plan_data = d)
#optimisation parameters and objectives
self.Status.Text = "En cours: Reglage des paramètres d'optimisation"
orl.orl_opt_settings(plan_data = d)
self.Status.Text = "En cours: Ajout des objectifs d'optimisation"
if self.check3.Checked:
optimization_objectives.add_opt_obj_orl(plan_data=d,yeux=True)
else:
optimization_objectives.add_opt_obj_orl(plan_data=d)
self.Status.Text = "En cours: Ajout des clinical goals"
clinical_goals.cg_orl(plan_data=d)
# Double optimization if requested by user
if self.check1.Checked:
self.Status.Text = "En cours: Première optimization"
patient.TreatmentPlans[d['plan_name']].PlanOptimizations[0].RunOptimization()
self.Status.Text = "En cours: Deuxième optimization"
patient.TreatmentPlans[d['plan_name']].PlanOptimizations[0].RunOptimization()
self.Status.Text = "En cours: Ajustement des paramètres d'optimisation"
optim.fit_objectives_orl(plan=patient.TreatmentPlans[d['plan_name']], beamset=patient.TreatmentPlans[d['plan_name']].BeamSets[0])
patient.TreatmentPlans[d['plan_name']].PlanOptimizations[0].OptimizationParameters.Algorithm.MaxNumberOfIterations = 29
self.Status.Text = "En cours: Optimisation post ajustement -30 itérations- "
patient.TreatmentPlans[d['plan_name']].PlanOptimizations[0].RunOptimization()
self.Status.Text = "Script terminé! Cliquez sur Cancel pour sortir."
self.Status.ForeColor = Color.Green
def cancelClicked(self, sender, args):
self.Close()
def setupMachineSelectPanel(self):
self.MachineSelectPanel = self.miniPanel(0, 450)
self.MachineLabel = Label()
self.MachineLabel.Text = "Appareil de traitement:"
self.MachineLabel.Location = Point(25, 30)
self.MachineLabel.Font = Font("Arial", 10)
self.MachineLabel.AutoSize = True
self.BeamModButton = RadioButton()
self.BeamModButton.Text = "BeamMod (salles 11-12)"
self.BeamModButton.Location = Point(40, 55)
self.BeamModButton.Checked = False
self.BeamModButton.AutoSize = True
self.InfinityButton = RadioButton()
self.InfinityButton.Text = "Infinity (salles 1-2-6)"
self.InfinityButton.Location = Point(40, 80)
self.InfinityButton.Checked = True
self.InfinityButton.AutoSize = True
self.MachineSelectPanel.Controls.Add(self.MachineLabel)
self.MachineSelectPanel.Controls.Add(self.BeamModButton)
self.MachineSelectPanel.Controls.Add(self.InfinityButton)
def setupOKButtons(self):
self.OKbuttonPanel = self.newPanel(0, 600)
okButton = Button()
okButton.Text = "OK"
okButton.Location = Point(25, 50)
self.AcceptButton = okButton
okButton.Click += self.okClicked
cancelButton = Button()
cancelButton.Text = "Cancel"
cancelButton.Location = Point(okButton.Left + okButton.Width + 10, okButton.Top)
self.CancelButton = cancelButton
cancelButton.Click += self.cancelClicked
self.Status = Label()
self.Status.Text = ""
self.Status.Location = Point(200, 50)
self.Status.AutoSize = True
self.Status.Font = Font("Arial", 12, FontStyle.Bold)
self.Status.ForeColor = Color.Black
self.OKbuttonPanel.Controls.Add(okButton)
self.OKbuttonPanel.Controls.Add(cancelButton)
self.OKbuttonPanel.Controls.Add(self.Status)
for CT in patient.Examinations:
self.scancombo.Items.Add(CT.Name)
try:
self.scancombo.SelectedIndex = self.scancombo.FindStringExact("CT 1")
except:
self.scancombo.SelectedIndex = 0
#Check for common errors while importing patient and examination
try:
patient = lib.get_current_patient()
except:
debug_window('Aucun patient sélectionné')
return
try:
exam = lib.get_current_examination()
except:
debug_window('Aucun examination trouvé')
return
form = ScriptLauncher()
Application.Run(form)