當前位置: 首頁>>代碼示例>>Python>>正文


Python pyqtgraph.RectROI方法代碼示例

本文整理匯總了Python中pyqtgraph.RectROI方法的典型用法代碼示例。如果您正苦於以下問題:Python pyqtgraph.RectROI方法的具體用法?Python pyqtgraph.RectROI怎麽用?Python pyqtgraph.RectROI使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pyqtgraph的用法示例。


在下文中一共展示了pyqtgraph.RectROI方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_getArrayRegion

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import RectROI [as 別名]
def test_getArrayRegion(transpose=False):
    pr = pg.PolyLineROI([[0, 0], [27, 0], [0, 28]], closed=True)
    pr.setPos(1, 1)
    rois = [
        (pg.ROI([1, 1], [27, 28], pen='y'), 'baseroi'),
        (pg.RectROI([1, 1], [27, 28], pen='y'), 'rectroi'),
        (pg.EllipseROI([1, 1], [27, 28], pen='y'), 'ellipseroi'),
        (pr, 'polylineroi'),
    ]
    for roi, name in rois:
        # For some ROIs, resize should not be used.
        testResize = not isinstance(roi, pg.PolyLineROI)
        
        origMode = pg.getConfigOption('imageAxisOrder')
        try:
            if transpose:
                pg.setConfigOptions(imageAxisOrder='row-major')
                check_getArrayRegion(roi, 'roi/'+name, testResize, transpose=True)
            else:
                pg.setConfigOptions(imageAxisOrder='col-major')
                check_getArrayRegion(roi, 'roi/'+name, testResize)
        finally:
            pg.setConfigOptions(imageAxisOrder=origMode) 
開發者ID:SrikanthVelpuri,項目名稱:tf-pose,代碼行數:25,代碼來源:test_ROI.py

示例2: __init__

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import RectROI [as 別名]
def __init__(self, model):
            sp = model
            _, _, sizeE, sizeN = sp.covariance.noise_coord

            self.patch_size_roi = pg.RectROI(
                pos=(0., 0.),
                size=(sizeE, sizeN),
                sideScalers=True,
                movable=False,
                pen=pen_roi)

            self._anisotropic = False
            self.components_available = {
                'synthetic_noise': [
                  'Noise',
                  lambda sp: sp.covariance.syntheticNoise(
                    self.sizePatchPx(), anisotropic=self.anisotropic)
                ]}

            self._component = 'synthetic_noise'

            KitePlot.__init__(self, model=model)
            self.patch_size_roi.sigRegionChangeFinished.connect(self.update)
            self.addItem(self.patch_size_roi) 
開發者ID:pyrocko,項目名稱:kite,代碼行數:26,代碼來源:tab_covariance.py

示例3: triggerKnobEnabledChange

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import RectROI [as 別名]
def triggerKnobEnabledChange(self, state):
        self.triggerKnobSource.setEnabled(state)
        self.triggerKnobDirection.setEnabled(state)
        if state:
            if self.triggX is None:
                self.triggX = 0.5
            if self.triggY is None:
                self.triggY = 0
            if self.triggerDiamond is None:
                self.triggerDiamond = pg.RectROI([self.triggX * self.samples / self.ratioBin, self.triggY],
                                                 [0, 0], invertible=True, pen=pg.mkPen(None))
                self.triggerDiamond.sigRegionChanged.connect(self.triggerDiamondUpdate)
                self.viewPlot.addItem(self.triggerDiamond)
        else:
            self.viewPlot.removeItem(self.triggerDiamond)
            self.triggerDiamond = None
        self.triggerReset = True 
開發者ID:picotech,項目名稱:picosdk-python-examples,代碼行數:19,代碼來源:picopyscope.py

示例4: ROI_selection

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import RectROI [as 別名]
def ROI_selection(self):
        draw = False
        if self.sizebtns.button(0).isChecked():
            wplot = 0
            view = self.p1.viewRange()
            draw = True
        elif self.sizebtns.button(2).isChecked():
            wplot = 1
            view = self.p2.viewRange()
            draw = True
        if draw:
            self.ROI_remove()
            self.topbtns.button(0).setStyleSheet(self.stylePressed)
            self.ROIplot = wplot
            imx = (view[0][1] + view[0][0]) / 2
            imy = (view[1][1] + view[1][0]) / 2
            dx = (view[0][1] - view[0][0]) / 4
            dy = (view[1][1] - view[1][0]) / 4
            dx = np.minimum(dx, 300)
            dy = np.minimum(dy, 300)
            imx = imx - dx / 2
            imy = imy - dy / 2
            self.ROI = pg.RectROI(
                [imx, imy], [dx, dy],
                pen="w", sideScalers=True
            )
            if wplot == 0:
                self.p1.addItem(self.ROI)
            else:
                self.p2.addItem(self.ROI)
            self.ROI_position()
            self.ROI.sigRegionChangeFinished.connect(self.ROI_position)
            self.isROI = True 
開發者ID:MouseLand,項目名稱:suite2p,代碼行數:35,代碼來源:gui2p.py


注:本文中的pyqtgraph.RectROI方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。