Beispiel #1
0
    def createIntensityTransferPage(self):
        """
		Creates a frame holding the entries for configuring 
					 intensity
		"""
        self.editIntensityPanel = wx.Panel(self.settingsNotebook, -1)
        self.editIntensitySizer = wx.GridBagSizer()

        self.iTFEditor = IntensityTransferEditor(self.editIntensityPanel)
        self.editIntensitySizer.Add(self.iTFEditor, (0, 0))  #,span=(1,2))

        self.box = wx.BoxSizer(wx.HORIZONTAL)
        self.editIntensitySizer.Add(self.box, (2, 0))
        self.createIntensityInterpolationPanel()

        self.restoreBtn = wx.Button(self.editIntensityPanel, -1,
                                    "Reset current timepoint")
        self.restoreBtn.Bind(wx.EVT_BUTTON, self.iTFEditor.restoreDefaults)
        self.box.Add(self.restoreBtn)

        self.resetBtn = wx.Button(self.editIntensityPanel, -1,
                                  "Reset all timepoints")
        self.resetBtn.Bind(wx.EVT_BUTTON, self.resetTransferFunctions)
        self.box.Add(self.resetBtn)

        self.copyiTFBtn = wx.Button(self.editIntensityPanel, -1,
                                    "Copy to all timepoints")
        self.copyiTFBtn.Bind(wx.EVT_BUTTON, self.copyTransferFunctionToAll)
        self.box.Add(self.copyiTFBtn)

        self.editIntensityPanel.SetSizer(self.editIntensitySizer)
        self.editIntensityPanel.SetAutoLayout(1)
        self.settingsNotebook.InsertPage(0, self.editIntensityPanel,
                                         "Transfer Function")
        self.settingsNotebook.SetSelection(0)

        self.updateSettings()
Beispiel #2
0
    def createOptionsFrame(self):
        """
		Creates a frame that contains the various widgets
					 used to control the colocalization settings
		"""
        TaskPanel.TaskPanel.createOptionsFrame(self)

        self.paletteLbl = wx.StaticText(self, -1, "Channel palette:")
        self.commonSettingsSizer.Add(self.paletteLbl, (1, 0))
        self.colorBtn = ColorTransferEditor.CTFButton(self)
        self.commonSettingsSizer.Add(self.colorBtn, (2, 0))

        self.editIntensityPanel = wx.Panel(self.settingsNotebook, -1)
        self.editIntensitySizer = wx.GridBagSizer()

        self.intensityTransferEditor = IntensityTransferEditor(
            self.editIntensityPanel)
        self.editIntensitySizer.Add(self.intensityTransferEditor, (0, 0),
                                    span=(1, 2))

        self.box = wx.BoxSizer(wx.HORIZONTAL)
        self.editIntensitySizer.Add(self.box, (2, 0))

        self.restoreBtn = wx.Button(self.editIntensityPanel, -1, "Reset")
        self.restoreBtn.Bind(wx.EVT_BUTTON,
                             self.intensityTransferEditor.restoreDefaults)
        self.box.Add(self.restoreBtn)

        # The alpha function doesn't need to be edited
        # Code left if futher need shows ups

        #self.editAlphaPanel = wx.Panel(self.settingsNotebook,-1)
        self.editAlphaPanel = wx.Panel(self.editIntensityPanel, -1)
        self.editAlphaSizer = wx.GridBagSizer()

        self.alphaModeBox = wx.RadioBox(self.editAlphaPanel, -1, "Alpha channel construction",
        choices = ["Maximum Mode", "Average Mode", "Image Luminance", "No alpha"], \
           majorDimension = 2, style = wx.RA_SPECIFY_COLS)

        self.alphaModeBox.SetForegroundColour(scripting.COLOR_EXPERIENCED)
        self.alphaModeBox.Bind(wx.EVT_RADIOBOX, self.modeSelect)

        self.averageLbl = wx.StaticText(self.editAlphaPanel, -1,
                                        "Average Threshold:")
        self.averageLbl.SetForegroundColour(scripting.COLOR_EXPERIENCED)
        self.averageEdit = wx.TextCtrl(self.editAlphaPanel,
                                       -1,
                                       "",
                                       size=(150, -1))
        self.averageEdit.Enable(0)
        self.averageEdit.SetForegroundColour(scripting.COLOR_EXPERIENCED)
        self.averageEdit.Bind(wx.EVT_TEXT_ENTER, self.onAverageEdit)
        self.averageEdit.Bind(wx.EVT_KILL_FOCUS, self.onAverageEdit)

        box = wx.BoxSizer(wx.HORIZONTAL)
        box.Add(self.averageLbl)
        box.Add(self.averageEdit)
        self.editAlphaSizer.Add(self.alphaModeBox, (0, 0))
        self.editAlphaSizer.Add(box, (2, 0))

        self.editAlphaPanel.SetSizer(self.editAlphaSizer)
        self.editAlphaSizer.Fit(self.editAlphaPanel)
        self.editIntensitySizer.Add(self.editAlphaPanel, (4, 0))

        self.editIntensityPanel.SetSizer(self.editIntensitySizer)
        self.editIntensityPanel.SetAutoLayout(1)

        self.editIntensityPanel.Layout()
        self.editIntensitySizer.Fit(self.editIntensityPanel)
        self.settingsNotebook.AddPage(self.editIntensityPanel, "Intensity")