コード例 #1
0
ファイル: renderers.py プロジェクト: FA1984/python-microscopy
    def GenerateGUI(self, event=None):
        import wx
        from PYME.LMVis import genImageDialog
        from PYME.DSView import ViewIm3D

        jitVars = ['1.0']
        jitVars += self.colourFilter.keys()

        self.genMeas = list(self.pipeline.GeneratedMeasures.keys())
        if not 'neighbourDistances' in self.genMeas:
            self.genMeas.append('neighbourDistances')

        if not 'neighbourErrorMin' in self.genMeas:
            self.genMeas.append('neighbourErrorMin')

        jitVars += self.genMeas

        if 'z' in self.pipeline.keys():
            zvals = self.pipeline['z']
        else:
            zvals = None

        dlg = genImageDialog.GenImageDialog(
            self.mainWind,
            mode=self.mode,
            defaultPixelSize=self._defaultPixelSize,
            colours=self.colourFilter.getColourChans(),
            zvals=zvals,
            jitterVariables=jitVars,
            jitterVarDefault=self._getDefaultJitVar(jitVars),
            jitterVarDefaultZ=self._getDefaultZJitVar(jitVars))
        ret = dlg.ShowModal()

        #bCurr = wx.BusyCursor()

        if ret == wx.ID_OK:
            im = self.Generate(dlg.get_settings())
            imfc = ViewIm3D(im,
                            mode='visGUI',
                            title='Generated %s - %3.1fnm bins' %
                            (self.name, im.pixelSize),
                            glCanvas=self.visFr.glCanvas,
                            parent=self.mainWind)
        else:
            imfc = None

        dlg.Destroy()
        return imfc
コード例 #2
0
ファイル: renderers.py プロジェクト: FA1984/python-microscopy
    def GenerateGUI(self, event=None):
        import wx
        from PYME.LMVis import genImageDialog
        from PYME.DSView import ViewIm3D

        dlg = genImageDialog.GenImageDialog(self.mainWind, mode=self.mode)
        ret = dlg.ShowModal()

        #bCurr = wx.BusyCursor()

        if ret == wx.ID_OK:
            img = self.Generate(dlg.get_settings())
            imf = ViewIm3D(img,
                           mode='visGUI',
                           title='Generated %s - %3.1fnm bins' %
                           (self.name, img.pixelSize),
                           glCanvas=self.visFr.glCanvas,
                           parent=self.mainWind)

            self.visFr.RefreshView()

        dlg.Destroy()
        return imf
コード例 #3
0
ファイル: splitRender.py プロジェクト: csoeller/PYME-extra
    def GenerateGUI(self, event=None, renderSettings=None, splitSettings=None):
        import wx
        from PYME.LMVis import genImageDialog
        from PYME.DSView import ViewIm3D

        if renderSettings is None:
            jitVars = ['1.0']
            jitVars += self.colourFilter.keys()

            self.genMeas = self.pipeline.GeneratedMeasures.keys()
            if not 'neighbourDistances' in self.genMeas:
                self.genMeas.append('neighbourDistances')

            if not 'neighbourErrorMin' in self.genMeas:
                self.genMeas.append('neighbourErrorMin')

            jitVars += self.genMeas

            if 'z' in self.pipeline.keys():
                zvals = self.pipeline['z']
            else:
                zvals = None

            dlg = genImageDialog.GenImageDialog(
                self.mainWind,
                mode=self.mode,
                defaultPixelSize=self._defaultPixelSize,
                colours=self.colourFilter.getColourChans(),
                zvals=zvals,
                jitterVariables=jitVars,
                jitterVarDefault=self._getDefaultJitVar(jitVars),
                jitterVarDefaultZ=self._getDefaultZJitVar(jitVars))
            ret = dlg.ShowModal()
            generateSettings = dlg.get_settings()
        else:
            ret = wx.ID_OK
            generateSettings = {
                'pixelSize': renderSettings['PixelSize'],
                'jitterVariable': 'neighbourDistances',
                'jitterScale': renderSettings['JitterFactor'],
                'jitterVariableZ': None,
                'jitterScaleZ': None,
                'MCProbability': 1.0,
                'numSamples': renderSettings['SamplesToAverage'],
                'colours': None,
                'zBounds': [None, None],
                'zSliceThickness': 200,
                'softRender': True
            }
        if ret == wx.ID_OK:
            im = self.Generate(generateSettings, splitSettings=splitSettings)
            imfc = ViewIm3D(im,
                            mode='visGUI',
                            title='Generated %s - %3.1fnm bins' %
                            (self.name, im.pixelSize),
                            glCanvas=self.visFr.glCanvas,
                            parent=self.mainWind)
        else:
            imfc = None

        dlg.Destroy()
        return imfc