示例#1
0
    def default_view(self):
        from traitsui.api import View, Item
        from PYME.ui.custom_traits_editors import CBEditor

        return View(Item('inputName',
                         editor=CBEditor(choices=self._namespace_keys)),
                    Item('_'),
                    Item('fit_type',
                         editor=CBEditor(choices=self._fitter_choices)),
                    Item('_'),
                    Item('outputName'),
                    buttons=['OK'])
示例#2
0
    def default_view(self):
        from traitsui.api import View, Group, Item
        from PYME.ui.custom_traits_editors import CBEditor

        return View(Item('inputName',
                         editor=CBEditor(choices=self._namespace_keys)),
                    Item('_'),
                    Item('IDkey', editor=CBEditor(choices=self._key_choices)),
                    Item('StatKey',
                         editor=CBEditor(choices=self._key_choices)),
                    Item('StatMethod'),
                    Item('_'),
                    Item('outputName'),
                    buttons=['OK'])
示例#3
0
    def default_view(self):
        from traitsui.api import View, Group, Item
        from PYME.ui.custom_traits_editors import CBEditor

        return View(Item('inputName',
                         editor=CBEditor(choices=self._namespace_keys)),
                    Item('_'),
                    Item('qIndexkey',
                         editor=CBEditor(choices=self._key_choices)),
                    Item('qindexValue'),
                    Item('NEquivalent'),
                    Item('_'),
                    Item('outputName'),
                    buttons=['OK'])
示例#4
0
    def default_view(self):
        from traitsui.api import View, Group, Item
        from PYME.ui.custom_traits_editors import CBEditor

        return View(Item('inputName',
                         editor=CBEditor(choices=self._namespace_keys)),
                    Item('_'),
                    Item('qIndexDenom',
                         editor=CBEditor(choices=self._key_choices)),
                    Item('qIndexNumer',
                         editor=CBEditor(choices=self._key_choices)),
                    Item('qIndexRatio'),
                    Item('_'),
                    Item('outputName'),
                    buttons=['OK'])
示例#5
0
    def pipeline_view(self):
        from traitsui.api import View, Item
        from PYME.ui.custom_traits_editors import CBEditor

        return View(
            Item('fit_type', editor=CBEditor(choices=self._fitter_choices)),
            Item('_'),
            Item(''),
            Item('ensemble_test_values'),
        )
示例#6
0
    def view(self, ds_keys):
        from traitsui.api import View, Item, Group
        from PYME.ui.custom_traits_editors import CBEditor

        return View([
            Item('vertexColour',
                 editor=CBEditor(choices=ds_keys),
                 label='Colour'),
            Item('point_size', label='Size [nm]')
        ])
示例#7
0
    def dsview_view(self):
        from traitsui.api import View, Item
        from PYME.ui.custom_traits_editors import CBEditor

        return View(Item('fit_type',
                         editor=CBEditor(choices=self._fitter_choices)),
                    Item('_'),
                    Item('ensemble_parameter_guess'),
                    Item('_'),
                    Item('hold_ensemble_parameter_constant'),
                    buttons=['OK'])
示例#8
0
    def pipeline_view(self):
        from traitsui.api import View, Group, Item
        from PYME.ui.custom_traits_editors import CBEditor

        modname = ','.join(
            self.inputs
        ) + ' -> ' + self.__class__.__name__ + ' -> ' + ','.join(self.outputs)

        return View(
            Group(Item('channel',
                       editor=CBEditor(choices=self._colour_choices)),
                  label=modname))
示例#9
0
    def default_view(self):
        import wx
        if wx.GetApp() is None:
            return None
        
        from traitsui.api import View, Group, Item
        from PYME.ui.custom_traits_editors import CBEditor, FilterEditor

        return View(Item('inputName', editor=CBEditor(choices=self._namespace_keys)),
                    Item('_'),
                    Item('filters', editor=FilterEditor(datasource=self._ds), show_label=False),
                    Item('_'),
                    Item('outputName'), buttons=['OK'])
示例#10
0
    def default_view(self):
        from traitsui.api import View, Group, Item, HGroup
        from PYME.ui.custom_traits_editors import CBEditor

        editable = self.class_editable_traits()
        inputs = [tn for tn in editable if tn.startswith('input')]
        return View(
            Group(Item('inputName', editor=CBEditor(choices=self._namespace_keys)),
                  HGroup(
                      Item('saveAs', show_label=False),
                      '_',
                      Item('fileName', style='readonly', springy=True)
                  )
            ), buttons=['OK'])
示例#11
0
    def default_view(self):
        import wx
        if wx.GetApp() is None:
            return None
        
        from traitsui.api import View, Group, Item, TextEditor, SetEditor
        from PYME.ui.custom_traits_editors import CBEditor, FilterEditor

        return View(Item('inputName', editor=CBEditor(choices=self._namespace_keys)),
                    Item('_'),
                    Item('idColumnName'),
                    Item('ids', editor=SetEditor(values=self._possible_ids)),
                    Item('_'),
                    Item('outputName'), buttons=['OK'])
    def no_localization_view(self):
        import wx
        if wx.GetApp() is None:
            return None

        from traitsui.api import View, Item
        from PYME.ui.custom_traits_editors import CBEditor

        inputs, outputs, params = self.get_params()

        return View([
            Item(name='input_image',
                 editor=CBEditor(choices=self._namespace_keys)),
        ] + [
            Item('_'),
        ] + self._view_items(params),
                    buttons=['OK', 'Cancel'])
示例#13
0
    def default_view(self):
        """ The default traits view - displayed when clicking on a recipe module in the full recipe view to edit it
        
        This can be over-ridden in a derived class to customise how the recipe module is edited and, e.g. specify custom
        traits editors. NOTE: Editing this property will NOT change how the module is displayed in the compact recipe
        overview displayed in VisGUI. **In most cases, it is preferable to over-ride the  `_view_items()` method** which
        just constructs the part of the view associated with the module parameters, leaving the base module to
        auto-generate the input and output sections.
        
        In general a view should have the inputs, a separator, the module parameters, another separator, and finally an OK button.
        
        Returns
        -------
        view : traitsui.View
            A traitsui `View` object, see `https://docs.enthought.com/traitsui/traitsui_user_manual/view.html`_
        
        See Also
        --------
        
        pipeline_view
        _view_items
            
        """
        import wx
        if wx.GetApp() is None:
            return None

        from traitsui.api import View, Item, Group
        from PYME.ui.custom_traits_editors import CBEditor

        inputs, outputs, params = self.get_params()

        return View(
            [
                Item(tn, editor=CBEditor(choices=self._namespace_keys))
                for tn in inputs
            ] + [
                Item('_'),
            ] + self._view_items(params) + [
                Item('_'),
            ] + [Item(tn) for tn in outputs],
            buttons=['OK']
        )  #TODO - should we have cancel? Traits update whilst being edited and cancel doesn't roll back
示例#14
0
    def default_view(self):
        from traitsui.api import View, Group, Item, TextEditor, CSVListEditor
        from PYME.ui.custom_traits_editors import CBEditor

        return View(
            Item('inputLocalizations',
                 editor=CBEditor(choices=self._namespace_keys)),
            Item('_'),
            Item('renderingModule'),
            Item('pixelSize'),
            Item('colours', style='text'),  #editor=CSVListEditor()),
            Item('softRender'),
            Group(
                Item('jitterVariable'),
                Item('jitterScale'),
                Item('jitterVariableZ',
                     visible_when='"3D" in renderingModule'),
                Item('jitterScaleZ', visible_when='"3D" in renderingModule'),
                Item('numSamples',
                     visible_when='"Triangulation" in renderingModule'),
                Item('MCProbability',
                     visible_when='"Triangulation" in renderingModule'),
                label='Jittering/Gaussian Size',
                visible_when=
                'not (("Histogram" in renderingModule) or (renderingModule=="Current"))'
            ),
            Group(Item('zSliceThickness'),
                  Item('zBoundsMode'),
                  Item('zBounds', visible_when='zBoundsMode=="manual"'),
                  label='3D',
                  visible_when='"3D" in renderingModule'),
            Group(
                Item('xyBoundsMode'),
                Item('manualXYBounds', visible_when='xyBoundsMode=="manual"'),
                label='Output Image Size',
            ),
            Item('_'),
            Item('outputImage'),
            buttons=['OK'])
示例#15
0
文件: base.py 项目: carandraug/PyME
    def default_view(self):
        import wx
        if wx.GetApp() is None:
            return None

        from traitsui.api import View, Item, Group
        from PYME.ui.custom_traits_editors import CBEditor

        #editable = self.class_editable_traits()
        #inputs = [tn for tn in editable if tn.startswith('input')]
        #outputs = [tn for tn in editable if tn.startswith('output')]
        #params = [tn for tn in editable if not (tn in inputs or tn in outputs or tn.startswith('_'))]
        inputs, outputs, params = self.get_params()

        return View([
            Item(tn, editor=CBEditor(choices=self._namespace_keys))
            for tn in inputs
        ] + [
            Item('_'),
        ] + [Item(tn) for tn in params] + [
            Item('_'),
        ] + [Item(tn) for tn in outputs],
                    buttons=['OK', 'Cancel'])
 def _view_items(self, params=None):
     from traitsui.api import Item
     from PYME.ui.custom_traits_editors import CBEditor
     return [
         Item('channel', editor=CBEditor(choices=self._colour_choices)),
     ]