Exemplo n.º 1
0
    def __createPlotStatusBar(self, plot):

        converters = [('X', lambda x, y: x), ('Y', lambda x, y: y),
                      ('Value', self.__getImageValue)]

        hbox = qt.QHBoxLayout()
        hbox.setContentsMargins(0, 0, 0, 0)

        info = PositionInfo(plot=plot, converters=converters)
        info.setSnappingMode(True)
        statusBar = qt.QStatusBar(plot)
        statusBar.setSizeGripEnabled(False)
        statusBar.addWidget(info)
        return statusBar
Exemplo n.º 2
0
    def __createPlotStatusBar(self, plot):

        converters = [
            ('X', lambda x, y: x),
            ('Y', lambda x, y: y),
            ('Value', self.__getImageValue)]

        hbox = qt.QHBoxLayout()
        hbox.setContentsMargins(0, 0, 0, 0)

        info = PositionInfo(plot=plot, converters=converters)
        info.setSnappingMode(True)
        statusBar = qt.QStatusBar(plot)
        statusBar.setSizeGripEnabled(False)
        statusBar.addWidget(info)
        return statusBar
Exemplo n.º 3
0
    def __init__(self, parent):
        super().__init__(parent=parent, aspectRatio=True, yinverted=True)

        self.setColormap("viridis", autoscale=True, normalization='log')
        self.setLabels(("images", "y (pixel)", "x (pixel)"))
        self.setTitleCallback(self.title)
        self.plot = self.getPlotWidget(
        ) if silx_version >= '0.13.0' else self.getPlot()
        self.plot.setYAxisInverted(True)

        self.action_already_created = False

        self.toolbar = QToolBar("Custom toolbar")
        self.plot.addToolBar(self.toolbar)
        self.action_use_flatfield = UseFlatfield(self.plot, parent=self)
        self.action_movie = DataViewerMovie(self.plot, parent=self)
        self.action_pause = PauseMovie(self.plot,
                                       self.action_movie,
                                       parent=self)
        self.action_resume = ResumeMovie(self.plot,
                                         self.action_movie,
                                         parent=self)

        self.toolbar.addAction(self.action_use_flatfield)
        self.toolbar.addAction(self.action_movie)
        self.toolbar.addAction(self.action_pause)

        position = PositionInfo(
            plot=self.plot,
            converters=[
                ('Xpixel', lambda x, y: int(x)),
                ('Ypixel', lambda x, y: int(y)),
                ('Intensity',
                 lambda x, y: self.getActiveImage().getData()[int(y)][int(x)])
            ])
        toolbar = QToolBar()
        toolbar.addWidget(position)
        self.getPlotWidget().addToolBar(Qt.BottomToolBarArea, toolbar)