def initialize(self):
        leginon.gui.wx.Settings.ScrolledDialog.initialize(self)
        sb = wx.StaticBox(self, -1, 'Settings')
        sbsz = wx.StaticBoxSizer(sb, wx.VERTICAL)

        sz = wx.GridBagSizer(5, 10)

        #self.widgets['image directory'] = filebrowse.FileBrowseButton(self, -1)
        presets = self.node.presetsclient.getPresetNames()
        label = wx.StaticText(self, -1, 'Transform From:')
        self.widgets['child preset'] = PresetChoice(self, -1)
        self.widgets['child preset'].setChoices(presets)
        sz.Add(label, (0, 0), (1, 1))
        sz.Add(self.widgets['child preset'], (0, 1), (1, 1),
               wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)

        label = wx.StaticText(self, -1, 'Transform To:')
        self.widgets['ancestor preset'] = PresetChoice(self, -1)
        self.widgets['ancestor preset'].setChoices(presets)
        sz.Add(label, (1, 0), (1, 1))
        sz.Add(self.widgets['ancestor preset'], (1, 1), (1, 1),
               wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)

        self.widgets['jump filename'] = Entry(self, -1, chars=12)
        label = wx.StaticText(self, -1, 'Image to Jump to:')
        sz.Add(label, (2, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        sz.Add(self.widgets['jump filename'], (2, 1), (1, 1),
               wx.ALIGN_CENTER | wx.FIXED_MINSIZE)

        sbsz.Add(sz, 0, wx.ALIGN_CENTER | wx.ALL, 5)

        return [
            sbsz,
        ]
Пример #2
0
        def initialize(self):
                szr = leginon.gui.wx.Reference.ScrolledSettings.initialize(self)
                sb = wx.StaticBox(self, -1, 'Check Zero Loss Peak Shift')
                sbsz = wx.StaticBoxSizer(sb, wx.VERTICAL)

                self.widgets['check preset'] = PresetChoice(self, -1)
                presets = self.node.presets_client.getPresetNames()
                self.widgets['check preset'].setChoices(presets)
                szcheck = wx.GridBagSizer(5, 5)
                szcheck.Add(wx.StaticText(self, -1, 'Use'), (0, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
                szcheck.Add(self.widgets['check preset'], (0, 1), (1, 1), wx.ALIGN_CENTER_VERTICAL)
                szcheck.Add(wx.StaticText(self, -1, 'to check if needing realignment'), (0, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL)

                self.widgets['threshold'] = FloatEntry(self, -1, min=0.0, allownone=False, chars=4, value='0.0')
                szt = wx.GridBagSizer(5, 5)
                szt.Add(wx.StaticText(self, -1, 'Start ALP if the image standard deviation is larger than'), (0, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
                szt.Add(self.widgets['threshold'], (0, 1), (1, 1), wx.ALIGN_CENTER_VERTICAL|wx.FIXED_MINSIZE)
                szt.Add(wx.StaticText(self, -1, 'times since last alignment'), (0, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL)

                sz = wx.GridBagSizer(5, 5)
                sz.Add(szcheck, (0, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
                sz.Add(szt, (1, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)

                sbsz.Add(sz, 0, wx.ALIGN_CENTER|wx.ALL, 5)

                return [szr[0],sbsz]
	def addRCTSettings(self):
		sb = wx.StaticBox(self, -1, 'RCT Options')
		sbsz = wx.StaticBoxSizer(sb, wx.VERTICAL)

		sizer = wx.GridBagSizer(5, 4)
		bordersize = 3

		label = wx.StaticText(self, -1, 'List of Tilts to Collect (in degrees)')
		sizer.Add(label, (0, 0), (1, 2), wx.ALIGN_CENTER_VERTICAL)
		self.widgets['tilts'] = Entry(self, -1, chars=15, style=wx.ALIGN_RIGHT)
		sizer.Add(self.widgets['tilts'], (0,2), (1,2), wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, bordersize)

		label = wx.StaticText(self, -1, 'Maximum Tilt Stepsize (in degrees)')
		sizer.Add(label, (1, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
		self.widgets['stepsize'] = IntEntry(self, -1, chars=2, value='15')
		sizer.Add(self.widgets['stepsize'], (1,1), (1,1), wx.ALL|wx.ALIGN_CENTER_VERTICAL, bordersize)

		label = wx.StaticText(self, -1, 'Pause Between Steps')
		sizer.Add(label, (1, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL)
		self.widgets['pause'] = FloatEntry(self, -1, chars=2, value='1')
		sizer.Add(self.widgets['pause'], (1,3), (1,1), wx.ALL|wx.ALIGN_CENTER_VERTICAL, bordersize)

		'''
		label = wx.StaticText(self, -1, 'Min Feature Size')
		sizer.Add(label, (2,0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
		self.widgets['minsize'] = FloatEntry(self, -1, chars=6, value='0.0')
		#sizer.Add(self.widgets['minsize'], (2,1), (1,1), wx.ALL|wx.ALIGN_CENTER_VERTICAL, bordersize)

		label = wx.StaticText(self, -1, 'Max Feature Size')
		sizer.Add(label, (2, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL)
		self.widgets['maxsize'] = FloatEntry(self, -1, chars=6, value='0.0')
		sizer.Add(self.widgets['maxsize'], (2,3), (1,1), wx.ALL|wx.ALIGN_CENTER_VERTICAL, bordersize)

		label = wx.StaticText(self, -1, 'Median Filter (pixels)')
		sizer.Add(label, (3, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
		self.widgets['medfilt'] = IntEntry(self, -1, chars=2, value='0')
		sizer.Add(self.widgets['medfilt'], (3,1), (1,1), wx.ALL|wx.ALIGN_CENTER_VERTICAL, bordersize)
		'''

		label = wx.StaticText(self, -1, 'LowPass Filter (pixels)')
		sizer.Add(label, (3, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL)
		self.widgets['lowfilt'] = IntEntry(self, -1, chars=2, value='0')
		sizer.Add(self.widgets['lowfilt'], (3,3), (1,1), wx.ALL|wx.ALIGN_CENTER_VERTICAL, bordersize)

		label = wx.StaticText(self, -1, 'Drift threshold')
		sizer.Add(label, (4, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
		self.widgets['drift threshold'] = FloatEntry(self, -1, chars=6, value='0.0')
		sizer.Add(self.widgets['drift threshold'], (4,1), (1,1), wx.ALL|wx.ALIGN_CENTER_VERTICAL, bordersize)

		label = wx.StaticText(self, -1, 'Drift preset')
		sizer.Add(label, (4, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL)
		presets = self.node.presetsclient.getPresetNames()
		self.widgets['drift preset'] = PresetChoice(self, -1)
		self.widgets['drift preset'].setChoices(presets)
		sizer.Add(self.widgets['drift preset'], (4,3), (1,1), wx.ALL|wx.ALIGN_CENTER_VERTICAL, bordersize)

		sbsz.Add(sizer, 0, wx.ALIGN_CENTER|wx.ALL, 2)

		return sbsz
    def initialize(self):
        leginon.gui.wx.Settings.ScrolledDialog.initialize(self)
        sb = wx.StaticBox(self, -1, 'Atlas')
        sbsz = wx.StaticBoxSizer(sb, wx.VERTICAL)

        presets = self.node.presetsclient.getPresetNames()
        self.widgets['preset'] = PresetChoice(self, -1)
        self.widgets['preset'].setChoices(presets)
        #self.widgets['label'] = Entry(self, -1)
        self.widgets['center'] = {}
        self.widgets['center']['x'] = FloatEntry(self, -1, chars=6)
        self.widgets['center']['y'] = FloatEntry(self, -1, chars=6)
        self.widgets['size'] = {}
        self.widgets['size']['x'] = FloatEntry(self, -1, chars=6)
        self.widgets['size']['y'] = FloatEntry(self, -1, chars=6)

        gsz = wx.GridBagSizer(5, 10)
        label = wx.StaticText(self, -1, 'x')
        gsz.Add(label, (0, 1), (1, 1), wx.ALIGN_CENTER)
        label = wx.StaticText(self, -1, 'y')
        gsz.Add(label, (0, 2), (1, 1), wx.ALIGN_CENTER)
        label = wx.StaticText(self, -1, 'Center:')
        gsz.Add(label, (1, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        gsz.Add(self.widgets['center']['x'], (1, 1), (1, 1), wx.ALIGN_CENTER)
        gsz.Add(self.widgets['center']['y'], (1, 2), (1, 1), wx.ALIGN_CENTER)
        label = wx.StaticText(self, -1, 'm')
        gsz.Add(label, (1, 3), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        label = wx.StaticText(self, -1, 'Size:')
        gsz.Add(label, (2, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        gsz.Add(self.widgets['size']['x'], (2, 1), (1, 1), wx.ALIGN_CENTER)
        gsz.Add(self.widgets['size']['y'], (2, 2), (1, 1), wx.ALIGN_CENTER)
        label = wx.StaticText(self, -1, 'm')
        gsz.Add(label, (2, 3), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        gsz.AddGrowableCol(0)

        sz = wx.GridBagSizer(5, 10)

        label = wx.StaticText(self, -1, 'Preset:')
        sz.Add(label, (0, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        sz.Add(self.widgets['preset'], (0, 1), (1, 1),
               wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)

        #label = wx.StaticText(self, -1, 'Label:')
        #sz.Add(label, (1, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        #sz.Add(self.widgets['label'], (1, 1), (1, 1),
        #				wx.ALIGN_CENTER_VERTICAL|wx.EXPAND)

        #sz.Add(gsz, (2, 0), (1, 3), wx.ALIGN_CENTER|wx.EXPAND)
        sz.Add(gsz, (1, 0), (1, 3), wx.ALIGN_CENTER | wx.EXPAND)

        sz.AddGrowableCol(1)

        sbsz.Add(sz, 1, wx.EXPAND | wx.ALL, 5)

        return [sbsz]
Пример #5
0
    def initialize(self):
        sb = wx.StaticBox(self, -1, 'Baker')
        sbsz = wx.StaticBoxSizer(sb, wx.VERTICAL)
        aftersb = wx.StaticBox(self, -1, 'After baking')
        aftersbsz = wx.StaticBoxSizer(aftersb, wx.VERTICAL)
        aftersz = wx.BoxSizer(wx.VERTICAL)

        self.widgets['bypass'] = wx.CheckBox(self, -1, 'Bypass Baking')
        self.widgets['preset'] = PresetChoice(self, -1)
        presets = self.node.presetsclient.getPresetNames()
        self.widgets['preset'].setChoices(presets)
        self.widgets['total bake time'] = FloatEntry(self,
                                                     -1,
                                                     min=0.0,
                                                     allownone=False,
                                                     chars=6,
                                                     value='10.0')
        self.widgets['manual aperture'] = wx.CheckBox(
            self, -1, 'Wait for user before continue to next task')
        self.widgets['emission off'] = wx.CheckBox(
            self, -1, 'Turn emission off when done')
        sz_bypass = wx.GridBagSizer(0, 0)
        sz_bypass.Add(self.widgets['bypass'], (0, 0), (1, 1),
                      wx.ALIGN_CENTER_VERTICAL)
        sz_preset = wx.GridBagSizer(5, 5)
        sz_preset.Add(wx.StaticText(self, -1, 'Use'), (0, 0), (1, 1),
                      wx.ALIGN_CENTER_VERTICAL)
        sz_preset.Add(self.widgets['preset'], (0, 1), (1, 1),
                      wx.ALIGN_CENTER_VERTICAL)
        sz_preset.Add(wx.StaticText(self, -1, 'to set the scope parameters'),
                      (0, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        sz_time = wx.GridBagSizer(5, 5)
        sz_time.Add(wx.StaticText(self, -1, 'Take'), (0, 0), (1, 1),
                    wx.ALIGN_CENTER_VERTICAL)
        sz_time.Add(self.widgets['total bake time'], (0, 1), (1, 1),
                    wx.ALIGN_CENTER_VERTICAL | wx.FIXED_MINSIZE)
        sz_time.Add(
            wx.StaticText(self, -1, 'seconds to move to the saved position'),
            (0, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        aftersz.Add(self.widgets['manual aperture'])
        aftersz.Add(self.widgets['emission off'])
        aftersbsz.Add(aftersz, wx.ALIGN_CENTER | wx.ALL)

        sz = wx.GridBagSizer(5, 5)
        sz.Add(sz_bypass, (0, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        sz.Add(sz_preset, (2, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        sz.Add(sz_time, (3, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        sz.Add(aftersbsz, (4, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)

        sbsz.Add(sz, 0, wx.ALIGN_CENTER | wx.ALL, 5)

        return [sbsz]
	def addBasicSettings(self):
		sz = wx.GridBagSizer(5, 10)
		# preset
		presets = self.node.presetsclient.getPresetNames()
		self.widgets['preset'] = PresetChoice(self, -1)
		self.widgets['preset'].setChoices(presets)
		label = wx.StaticText(self, -1, 'Preset:')
		sz.Add(label, (0, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
		sz.Add(self.widgets['preset'], (0, 1), (1, 1),
						wx.ALIGN_CENTER_VERTICAL|wx.EXPAND)
		# atlas label
		self.widgets['label'] = Entry(self, -1, allowspaces=False)
		label = wx.StaticText(self, -1, 'Label:')
		sz.Add(label, (1, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
		sz.Add(self.widgets['label'], (1, 1), (1, 1),
						wx.ALIGN_CENTER_VERTICAL|wx.EXPAND)
		# radius
		self.widgets['radius'] = FloatEntry(self, -1, min=0.0, chars=6)
		label = wx.StaticText(self, -1, 'Radius:')
		sz.Add(label, (2, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
		#sz.Add(szradius, (2, 1), (1, 1), wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT)
		sz.Add(self.widgets['radius'], (2, 1), (1, 1),
										wx.ALIGN_CENTER_VERTICAL|wx.FIXED_MINSIZE|wx.ALIGN_RIGHT)
		label = wx.StaticText(self, -1, 'm')
		sz.Add(label, (2, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL)

		'''
		# atlas max size
		self.widgets['max size'] = IntEntry(self, -1)
		label = wx.StaticText(self, -1, 'Max size:')
		sz.Add(label, (3, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
		sz.Add(self.widgets['max size'], (3, 1), (1, 1),
						wx.ALIGN_CENTER_VERTICAL|wx.EXPAND)

		# atlas max size
		self.widgets['max targets'] = IntEntry(self, -1)
		label = wx.StaticText(self, -1, 'Max targets:')
		sz.Add(label, (4, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
		sz.Add(self.widgets['max targets'], (4, 1), (1, 1),
						wx.ALIGN_CENTER_VERTICAL|wx.EXPAND)
		'''

		return sz
        def initialize(self):
                leginon.gui.wx.Settings.ScrolledDialog.initialize(self)
                sb = wx.StaticBox(self, -1, 'Raster')
                sbszraster = wx.StaticBoxSizer(sb, wx.VERTICAL)
                sb = wx.StaticBox(self, -1, 'Spacing/Angle Calculator')
                sbszauto = wx.StaticBoxSizer(sb, wx.VERTICAL)

                self.widgets['raster spacing'] = IntEntry(self, -1, chars=4, min=1)
                self.widgets['raster spacing asymm'] = IntEntry(self, -1, chars=4)
                self.widgets['raster limit'] = IntEntry(self, -1, chars=4, min=1)
                self.widgets['raster limit asymm'] = IntEntry(self, -1, chars=4)
                self.widgets['raster angle'] = FloatEntry(self, -1, chars=4)
                self.widgets['raster center on image'] = wx.CheckBox(self, -1, 'Center on image')
                self.widgets['raster center x'] = IntEntry(self, -1, chars=4)
                self.widgets['raster center y'] = IntEntry(self, -1, chars=4)
                self.widgets['raster symmetric'] = wx.CheckBox(self, -1, '&Symmetric')

                ## auto raster
                self.autobut = wx.Button(self, -1, 'Calculate spacing and angle using the following parameters:')
                self.Bind(wx.EVT_BUTTON, self.onAutoButton, self.autobut)
                self.widgets['raster preset'] = PresetChoice(self, -1)
                presets = self.node.presetsclient.getPresetNames()
                self.widgets['raster preset'].setChoices(presets)
                self.widgets['raster overlap'] = FloatEntry(self, -1, chars=8)


                szauto = wx.GridBagSizer(5, 5)
                szauto.Add(self.autobut, (0, 0), (1, 2), wx.ALIGN_CENTER_VERTICAL)
                label = wx.StaticText(self, -1, 'Raster Preset')
                szauto.Add(label, (1, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
                szauto.Add(self.widgets['raster preset'], (1, 1), (1, 1), wx.ALIGN_CENTER_VERTICAL)
                label = wx.StaticText(self, -1, 'Overlap percent')
                szauto.Add(label, (2, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
                szauto.Add(self.widgets['raster overlap'], (2, 1), (1, 1), wx.ALIGN_CENTER_VERTICAL)

                movetypes = self.node.calclients.keys()
                self.widgets['raster movetype'] = Choice(self, -1, choices=movetypes)
                label = wx.StaticText(self, -1, 'Move Type')
                szauto.Add(label, (3, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
                szauto.Add(self.widgets['raster movetype'], (3, 1), (1, 1), wx.ALIGN_CENTER_VERTICAL)
                sbszauto.Add(szauto, 1, wx.EXPAND|wx.ALL,5)

                szraster = wx.GridBagSizer(5, 5)

                label = wx.StaticText(self, -1, 'XY symmetry:')
                szraster.Add(label, (0,0), (1,1) , wx.ALIGN_CENTER_VERTICAL)

                self.Bind(wx.EVT_CHECKBOX, self.onToggleSymm, self.widgets['raster symmetric'])
                szraster.Add(self.widgets['raster symmetric'], (0,1), (1,2) , wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT)
                self.widgets['raster symmetric'].SetMinSize((120,30))

                label = wx.StaticText(self, -1, 'Spacing (x,y):')
                szraster.Add(label, (1,0), (1,1), wx.ALIGN_CENTER_VERTICAL)
                szraster.Add(self.widgets['raster spacing'], (1,1), (1,1), 
                        wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT)
                szraster.Add(self.widgets['raster spacing asymm'], (1,2), (1,1), 
                        wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT)

                label = wx.StaticText(self, -1, 'Num points (x,y):')
                szraster.Add(label, (2,0), (1,1), wx.ALIGN_CENTER_VERTICAL)
                szraster.Add(self.widgets['raster limit'], (2,1), (1,1),
                        wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT)
                szraster.Add(self.widgets['raster limit asymm'], (2,2), (1,1),
                        wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT)
                szraster.AddGrowableCol(1)

                label = wx.StaticText(self, -1, 'Angle:')
                szraster.Add(label, (3,0), (1,1), wx.ALIGN_CENTER_VERTICAL)
                szraster.Add(self.widgets['raster angle'], (3,1), (1,2), 
                        wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_CENTER_HORIZONTAL)

                szraster.Add(self.widgets['raster center on image'], (4,0), (1,3), 
                        wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_CENTER_HORIZONTAL)
                self.Bind(wx.EVT_CHECKBOX, self.onCheckBox, self.widgets['raster center on image'])

                label = wx.StaticText(self, -1, 'Center on x,y:')
                szraster.Add(label, (5,0), (1,1), wx.ALIGN_CENTER_VERTICAL)
                szraster.Add(self.widgets['raster center x'], (5,1), (1,1), wx.ALIGN_CENTER_VERTICAL)
                szraster.Add(self.widgets['raster center y'], (5,2), (1,1), wx.ALIGN_CENTER_VERTICAL)

                if self.widgets['raster center on image'].GetValue():
                        self.widgets['raster center x'].Enable(False)
                        self.widgets['raster center y'].Enable(False)

                if self.widgets['raster symmetric'].GetValue():
                        self.widgets['raster spacing asymm'].Enable(False)
                        self.widgets['raster limit asymm'].Enable(False)
                        self.widgets['raster spacing asymm'].SetValue(None)
                        self.widgets['raster limit asymm'].SetValue(None)
                else:
                        self.widgets['raster spacing asymm'].Enable(True)
                        self.widgets['raster limit asymm'].Enable(True)         

                sbszraster.Add(szraster, 1, wx.EXPAND|wx.ALL, 5)

                self.btest = wx.Button(self, -1, 'Test')
                szbutton = wx.GridBagSizer(5, 5)
                szbutton.Add(self.btest, (0, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT)
                szbutton.AddGrowableCol(0)

                self.Bind(wx.EVT_BUTTON, self.onTestButton, self.btest)

                return [sbszauto,sbszraster, szbutton]
    def addSettings(self):
        presets = self.node.presetsclient.getPresetNames()
        self.widgets['preset'] = PresetChoice(self, -1)
        self.widgets['preset'].setChoices(presets)
        self.widgets['label'] = Entry(self, -1, allowspaces=False)
        self.widgets['radius'] = FloatEntry(self, -1, min=0.0, chars=6)
        self.widgets['max size'] = IntEntry(self, -1, chars=6)
        self.widgets['max targets'] = IntEntry(self, -1, chars=6)
        self.widgets['overlap'] = FloatEntry(self, -1, max=100.0, chars=6)
        self.widgets['mosaic center'] = Choice(
            self, -1, choices=['stage center', 'current position'])
        self.widgets['ignore request'] = wx.CheckBox(
            self, -1, 'Ignore Request to Make Targets from Others')

        #szradius = wx.GridBagSizer(5, 5)
        #szradius.Add(self.widgets['radius'], (0, 0), (1, 1),
        #                                                               wx.ALIGN_CENTER_VERTICAL|wx.FIXED_MINSIZE)
        #label = wx.StaticText(self, -1, 'meters')
        #szradius.Add(label, (0, 1), (1, 1), wx.ALIGN_CENTER_VERTICAL)

        sz = wx.GridBagSizer(5, 10)

        label = wx.StaticText(self, -1, 'Preset:')
        sz.Add(label, (0, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        sz.Add(self.widgets['preset'], (0, 1), (1, 1),
               wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)

        label = wx.StaticText(self, -1, 'Label:')
        sz.Add(label, (1, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        sz.Add(self.widgets['label'], (1, 1), (1, 1),
               wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)

        label = wx.StaticText(self, -1, 'Radius:')
        sz.Add(label, (2, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        #sz.Add(szradius, (2, 1), (1, 1), wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT)
        sz.Add(self.widgets['radius'], (2, 1), (1, 1),
               wx.ALIGN_CENTER_VERTICAL | wx.FIXED_MINSIZE | wx.ALIGN_RIGHT)
        label = wx.StaticText(self, -1, 'm')
        sz.Add(label, (2, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL)

        label = wx.StaticText(self, -1, 'Max size:')
        sz.Add(label, (3, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        sz.Add(self.widgets['max size'], (3, 1), (1, 1),
               wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)

        label = wx.StaticText(self, -1, 'Max targets:')
        sz.Add(label, (4, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        sz.Add(self.widgets['max targets'], (4, 1), (1, 1),
               wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)

        label = wx.StaticText(self, -1, 'Overlap:')
        sz.Add(label, (5, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        sz.Add(self.widgets['overlap'], (5, 1), (1, 1),
               wx.ALIGN_CENTER_VERTICAL | wx.FIXED_MINSIZE | wx.ALIGN_RIGHT)
        label = wx.StaticText(self, -1, '%')
        sz.Add(label, (5, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL)

        label = wx.StaticText(self, -1, 'Mosaic Center:')
        sz.Add(label, (6, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        sz.Add(self.widgets['mosaic center'], (6, 1), (1, 1),
               wx.ALIGN_CENTER_VERTICAL | wx.FIXED_MINSIZE | wx.ALIGN_RIGHT)

        sz.Add(self.widgets['ignore request'], (7, 0), (1, 3),
               wx.ALIGN_CENTER_VERTICAL)

        sz.AddGrowableCol(1)

        return sz
Пример #9
0
    def initialize(self):
        leginon.gui.wx.Settings.ScrolledDialog.initialize(self)
        sb = wx.StaticBox(self, -1, 'Spacing/Angle Calculator')
        sbszauto = wx.StaticBoxSizer(sb, wx.VERTICAL)

        szoptions = wx.GridBagSizer(5, 5)

        ## auto raster
        self.widgets['raster preset'] = PresetChoice(self, -1)
        presets = self.node.presetsclient.getPresetNames()
        self.widgets['raster preset'].setChoices(presets)
        self.widgets['raster overlap'] = FloatEntry(self, -1, chars=8)
        movetypes = self.node.calclients.keys()
        self.widgets['raster movetype'] = Choice(self, -1, choices=movetypes)
        self.autobut = wx.Button(
            self, -1,
            'Calculate spacing and angle using the following parameters:')

        szauto = wx.GridBagSizer(5, 5)
        szauto.Add(self.autobut, (0, 0), (1, 2), wx.ALIGN_CENTER_VERTICAL)
        label = wx.StaticText(self, -1, 'Raster Preset')
        szauto.Add(label, (1, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        szauto.Add(self.widgets['raster preset'], (1, 1), (1, 1),
                   wx.ALIGN_CENTER_VERTICAL)
        label = wx.StaticText(self, -1, 'Overlap percent')
        szauto.Add(label, (2, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        szauto.Add(self.widgets['raster overlap'], (2, 1), (1, 1),
                   wx.ALIGN_CENTER_VERTICAL)
        label = wx.StaticText(self, -1, 'Move Type')
        szauto.Add(label, (3, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        szauto.Add(self.widgets['raster movetype'], (3, 1), (1, 1),
                   wx.ALIGN_CENTER_VERTICAL)
        sbszauto.Add(szauto, 1, wx.EXPAND | wx.ALL, 5)

        self.Bind(wx.EVT_BUTTON, self.onAutoButton, self.autobut)
        ## end of auto raster

        szoptions.Add(sbszauto, (0, 0), (1, 2), wx.ALIGN_CENTER_VERTICAL)

        label = wx.StaticText(self, -1, 'Raster Spacing')
        self.widgets['raster spacing'] = FloatEntry(self, -1, chars=8)
        szoptions.Add(label, (1, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        szoptions.Add(self.widgets['raster spacing'], (1, 1), (1, 1),
                      wx.ALIGN_CENTER_VERTICAL)

        label = wx.StaticText(self, -1, 'Raster Angle')
        self.widgets['raster angle'] = FloatEntry(self, -1, chars=8)
        szoptions.Add(label, (2, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        szoptions.Add(self.widgets['raster angle'], (2, 1), (1, 1),
                      wx.ALIGN_CENTER_VERTICAL)

        szbutton = wx.GridBagSizer(5, 5)

        self.bclear = wx.Button(self, -1, 'Clear Targets')
        szbutton.Add(self.bclear, (0, 0), (1, 1),
                     wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT)
        szbutton.AddGrowableCol(0)

        self.Bind(wx.EVT_BUTTON, self.onClearButton, self.bclear)

        self.btest = wx.Button(self, -1, 'Test')
        szbutton.Add(self.btest, (0, 1), (1, 1),
                     wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT)
        szbutton.AddGrowableCol(1)

        self.Bind(wx.EVT_BUTTON, self.onTestButton, self.btest)

        return [szoptions, szbutton]
    def initialize(self):
        leginon.gui.wx.Settings.ScrolledDialog.initialize(self)
        sbr = wx.StaticBox(self, -1, 'Target Raster')
        sbszr = wx.StaticBoxSizer(sbr, wx.VERTICAL)
        sbcalc = wx.StaticBox(self, -1, 'Spacing/Angle Calculator')
        sbszcalc = wx.StaticBoxSizer(sbcalc, wx.VERTICAL)
        sblimit = wx.StaticBox(self, -1, 'Limiting Shape')
        sbszlimit = wx.StaticBoxSizer(sblimit, wx.VERTICAL)

        sz = wx.GridBagSizer(5, 10)

        self.widgets['bypass'] = wx.CheckBox(self, -1, 'Bypass Filter')
        targettypes = ['acquisition', 'preview']
        self.widgets['target type'] = wx.Choice(self, -1, choices=targettypes)
        self.widgets['user check'] = wx.CheckBox(
            self, -1, 'Verify filter before submitting')

        self.widgets['raster spacing'] = FloatEntry(self, -1, min=0, chars=6)
        self.widgets['raster angle'] = FloatEntry(self, -1, chars=8)
        self.widgets['raster offset'] = wx.CheckBox(
            self, -1, 'offset by half an image every other row')
        self.widgets['ellipse angle'] = FloatEntry(self, -1, chars=6)
        self.widgets['ellipse a'] = FloatEntry(self, -1, min=0, chars=6)
        self.widgets['ellipse b'] = FloatEntry(self, -1, min=0, chars=6)
        shapetypes = ['ellipse', 'rectangle']
        self.widgets['limiting shape'] = wx.Choice(self,
                                                   -1,
                                                   choices=shapetypes)

        movetypes = self.node.calclients.keys()
        self.widgets['raster movetype'] = Choice(self, -1, choices=movetypes)
        self.autobut = wx.Button(
            self, -1,
            'Calculate spacing and angle using the following parameters:')
        self.Bind(wx.EVT_BUTTON, self.onAutoButton, self.autobut)
        self.widgets['raster preset'] = PresetChoice(self, -1)
        presets = self.node.presetsclient.getPresetNames()
        self.widgets['raster preset'].setChoices(presets)
        self.widgets['raster overlap'] = FloatEntry(self, -1, chars=8)

        ## filter
        sztype = wx.GridBagSizer(0, 5)
        sztype.Add(self.widgets['bypass'], (0, 0), (1, 1),
                   wx.ALIGN_CENTER_VERTICAL)
        label = wx.StaticText(self, -1, 'Convoluting Target Type')
        sztype.Add(label, (0, 1), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        sztype.Add(self.widgets['target type'], (0, 2), (1, 1),
                   wx.ALIGN_CENTER_VERTICAL)
        sztype.Add(self.widgets['user check'], (1, 0), (1, 1),
                   wx.ALIGN_CENTER_VERTICAL)
        sztype.AddGrowableCol(0)
        sz.Add(sztype, (0, 0), (1, 2), wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)

        ## auto raster calculator
        szcalc = wx.GridBagSizer(5, 5)
        szcalc.Add(self.autobut, (0, 0), (1, 2), wx.ALIGN_CENTER_VERTICAL)
        label = wx.StaticText(self, -1, 'Preset for raster')
        szcalc.Add(label, (1, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        szcalc.Add(self.widgets['raster preset'], (1, 1), (1, 1),
                   wx.ALIGN_CENTER_VERTICAL)
        label = wx.StaticText(self, -1, 'Overlap Percent')
        szcalc.Add(label, (2, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        szcalc.Add(self.widgets['raster overlap'], (2, 1), (1, 1),
                   wx.ALIGN_CENTER_VERTICAL)

        label = wx.StaticText(self, -1, 'Move Type')
        szcalc.Add(label, (3, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        szcalc.Add(self.widgets['raster movetype'], (3, 1), (1, 1),
                   wx.ALIGN_CENTER_VERTICAL)

        sbszcalc.Add(szcalc, 0, wx.ALIGN_CENTER | wx.ALL, 5)
        sz.Add(sbszcalc, (1, 0), (1, 2), wx.EXPAND)

        ## raster
        szr = wx.GridBagSizer(5, 5)
        label = wx.StaticText(self, -1, 'Spacing')
        szr.Add(label, (0, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        szr.Add(self.widgets['raster spacing'], (0, 1), (1, 1),
                wx.ALIGN_CENTER_VERTICAL)
        label = wx.StaticText(self, -1, 'pixels in parent image')
        szr.Add(label, (0, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL)

        label = wx.StaticText(self, -1, 'Angle')
        szr.Add(label, (1, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        szr.Add(self.widgets['raster angle'], (1, 1), (1, 1),
                wx.ALIGN_CENTER_VERTICAL)
        label = wx.StaticText(self, -1, 'degrees')
        szr.Add(label, (1, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        szr.Add(self.widgets['raster offset'], (2, 0), (1, 3),
                wx.ALIGN_CENTER_VERTICAL)
        label = wx.StaticText(self, -1, 'Limit the raster by')
        szr.Add(label, (3, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        szr.Add(self.widgets['limiting shape'], (3, 1), (1, 1),
                wx.ALIGN_CENTER_VERTICAL)

        ## raster limiting ellipse
        szlimit = wx.GridBagSizer(0, 5)
        label = wx.StaticText(self, -1, 'Angle to a-axis')
        szlimit.Add(label, (0, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        szlimit.Add(self.widgets['ellipse angle'], (0, 1), (1, 1),
                    wx.ALIGN_CENTER_VERTICAL)
        label = wx.StaticText(self, -1, 'degrees')
        szlimit.Add(label, (0, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL)

        label = wx.StaticText(self, -1, '2 * a-axis (Width)')
        szlimit.Add(label, (1, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        szlimit.Add(self.widgets['ellipse a'], (1, 1), (1, 1),
                    wx.ALIGN_CENTER_VERTICAL)
        label = wx.StaticText(self, -1, 'raster spacings')
        szlimit.Add(label, (1, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL)

        label = wx.StaticText(self, -1, '2 * b-axis (Height)')
        szlimit.Add(label, (2, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL)
        szlimit.Add(self.widgets['ellipse b'], (2, 1), (1, 1),
                    wx.ALIGN_CENTER_VERTICAL)
        label = wx.StaticText(self, -1, 'raster spacings')
        szlimit.Add(label, (2, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL)

        sbszlimit.Add(szlimit, 0, wx.ALIGN_CENTER | wx.ALL, 5)
        szr.Add(sbszlimit, (4, 0), (1, 3), wx.EXPAND)

        sbszr.Add(szr, 0, wx.ALIGN_CENTER | wx.ALL, 5)
        sz.Add(sbszr, (2, 0), (1, 2), wx.EXPAND)

        #test button
        testbut = wx.Button(self, -1, 'test')
        sz.Add(testbut, (3, 0), (1, 2), wx.ALIGN_RIGHT)
        self.Bind(wx.EVT_BUTTON, self.onTestButton, testbut)

        #sb = wx.StaticBox(self, -1, 'Target Filter')
        #sbsz = wx.StaticBoxSizer(sb, wx.VERTICAL)
        #sbsz.Add(sz, 0, wx.ALIGN_CENTER|wx.ALL, 5)

        return [sz]