コード例 #1
0
	def __init__(self, plan):
		self.Text = "Choose the apropriate ROI"
		
		structure_set = plan.GetStructureSet()
		self.roi_names = sorted([rg.OfRoi.Name for rg in structure_set.RoiGeometries if rg.PrimaryShape != None])
		self.roi_colors = [rg.OfRoi.Color for rg in structure_set.RoiGeometries if rg.PrimaryShape != None]
		
		self.Width = 160*4 + 50
		self.Height = 55*int(ceil(len(self.roi_names)/4.)) + 150
		
		print self.roi_colors
		
		self.setupCheckButtons()
		
		# Add button to press OK and close the Form
		button = Button()
		button.Text = "OK"
		button.AutoSize = True
		button.Location = Point(self.Width - 105, self.Height - 100)
		button.Click += self.ok_button_clicked
		
		# Add button to press Stop and close the Form
		button2 = Button()
		button2.Text = "Stop"
		button2.AutoSize = True
		button2.Location = Point(self.Width - 210, self.Height - 100)
		button2.Click += self.stop_button_clicked
		
		self.Controls.Add(button)
		self.Controls.Add(button2)
		
		self.Controls.Add(self.checkPanel)
コード例 #2
0
    def __init__(self, plan):
        # Set the size of the form
        self.Size = Size(500, 200)
        # Set title of the form
        self.Text = 'Approximate fiducial location'

        # Add a label
        label = Label()
        label.Text = 'Type the approximate fiducial location in mm'
        label.Location = Point(15, 15)
        label.AutoSize = True
        self.Controls.Add(label)

        # Add a TextBox
        self.textbox = TextBox()
        self.textbox.Location = Point(15, 60)
        self.textbox.Width = 150
        self.Controls.Add(self.textbox)

        # Add button to press OK and close the form
        button = Button()
        button.Text = 'OK'
        button.AutoSize = True
        button.Location = Point(15, 100)
        button.Click += self.ok_button_clicked
        self.Controls.Add(button)