Пример #1
0
    def __init__(self):
        QtGui.QWidget.__init__(self)

        self.layout = QtGui.QVBoxLayout()
        self.setLayout(self.layout)
        self.imv1 = pg.ImageView()
        self.layout.addWidget(self.imv1)

        self.plt1 = pg.PlotWidget()
        self.layout.addWidget(self.plt1)

        self.base_time_rgn = pg.LinearRegionItem([0.07, 0.099])
        self.test_time_rgn = pg.LinearRegionItem([0.104, 0.112])
        for time_rgn in (self.base_time_rgn, self.test_time_rgn):
            self.plt1.addItem(time_rgn)
            time_rgn.sigRegionChangeFinished.connect(self.time_rgn_changed)

        self.plot_data = []
Пример #2
0
    def __init__(self):
        QtGui.QWidget.__init__(self)

        self.layout = QtGui.QGridLayout()
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(self.layout)

        # Set up filter buttons
        self.btns = OrderedDict()
        row, col = 0, 0
        for name in ['Mean', 'Max', 'Max w/Gaussian', 'Max w/Median', 'Edge']:
            btn = QtGui.QPushButton(name)
            self.btns[name] = btn
            btn.setCheckable(True)
            self.layout.addWidget(btn, row, col)
            btn.clicked.connect(self.filterBtnClicked)
            col += 1
            if col > 1:
                col = 0
                row += 1

        # show flowchart control panel inside a collapsible group box
        self.fcGroup = pg.GroupBox('Filter Settings')
        fgl = QtGui.QVBoxLayout()
        self.fcGroup.setLayout(fgl)
        fgl.setContentsMargins(0, 0, 0, 0)
        self.layout.addWidget(self.fcGroup, row + 1, 0, 1, 2)
        self.fc = pg.flowchart.Flowchart(terminals={
            'dataIn': {
                'io': 'in'
            },
            'dataOut': {
                'io': 'out'
            }
        })
        fgl.addWidget(self.fc.widget())
        self.fcGroup.setCollapsed(True)
        self.fc.sigStateChanged.connect(self.sigStateChanged)