本文整理汇总了Python中pyqtgraph.EllipseROI方法的典型用法代码示例。如果您正苦于以下问题:Python pyqtgraph.EllipseROI方法的具体用法?Python pyqtgraph.EllipseROI怎么用?Python pyqtgraph.EllipseROI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtgraph
的用法示例。
在下文中一共展示了pyqtgraph.EllipseROI方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_getArrayRegion
# 需要导入模块: import pyqtgraph [as 别名]
# 或者: from pyqtgraph import EllipseROI [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)
示例2: remove_last_roi
# 需要导入模块: import pyqtgraph [as 别名]
# 或者: from pyqtgraph import EllipseROI [as 别名]
def remove_last_roi(self):
if self.rois:
if isinstance(self.rois[-1], pg.EllipseROI):
self.removeItem(self.rois[-1])
self.rois = self.rois[:-1]
self.draw_ellipse = None
else:
h = self.rois[-1].handles[-1]['item']
self.rois[-1].removeHandle(h)
if not self.rois[-1].segments:
self.removeItem(self.rois[-1])
self.rois = self.rois[:-1]
self.draw_line = None
if self.rois:
if isinstance(self.rois[-1], pg.EllipseROI):
self.draw_ellipse = self.rois[-1]
else:
self.draw_line = self.rois[-1]
self.set_draw_line_color(draw_line_color)
return True
示例3: __init__
# 需要导入模块: import pyqtgraph [as 别名]
# 或者: from pyqtgraph import EllipseROI [as 别名]
def __init__(self, **kwargs):
""" """
super().__init__(**kwargs)
# We need to initialise the ellipse, add it to the area, and remove
# the handles from the ellipseROI:
self.fly_ell = pg.EllipseROI(pos=(0, 0), size=(10, 10), movable=False, pen=None)
self.display_area.addItem(self.fly_ell)
[self.fly_ell.removeHandle(h) for h in self.fly_ell.getHandles()]
self.pre_th = 0
示例4: __init__
# 需要导入模块: import pyqtgraph [as 别名]
# 或者: from pyqtgraph import EllipseROI [as 别名]
def __init__(self, **kwargs):
""" """
super().__init__(**kwargs)
# Draw ROI for eyes region selection:
self.pre_th = [0, 0]
self.eye_params = self.experiment.pipeline.eyetrack._params
self.roi_eyes = pg.ROI(
pos=self.eye_params.wnd_pos,
size=self.eye_params.wnd_dim,
pen=dict(color=(5, 40, 200), width=3),
)
self.roi_eyes.addScaleHandle([0, 0], [1, 1])
self.roi_eyes.addScaleHandle([1, 1], [0, 0])
self.curves_eyes = [
pg.EllipseROI(
pos=(0, 0), size=(10, 10), movable=False, pen=dict(color=k, width=3)
)
for k in [(5, 40, 230), (40, 230, 5)]
]
for c in self.curves_eyes:
self.display_area.addItem(c)
[c.removeHandle(h) for h in c.getHandles()]
self.initialise_roi(self.roi_eyes)
self.setting_param_val = False
示例5: draw
# 需要导入模块: import pyqtgraph [as 别名]
# 或者: from pyqtgraph import EllipseROI [as 别名]
def draw(self, parent, imy, imx, dy, dx):
roipen = pg.mkPen(self.color, width=3,
style=QtCore.Qt.SolidLine)
self.ROI = pg.EllipseROI([imx, imy], [dx, dy], pen=roipen, removable=True)
self.ROI.handleSize = 8
self.ROI.handlePen = roipen
self.ROI.addScaleHandle([1, 0.5], [0., 0.5])
self.ROI.addScaleHandle([0.5, 0], [0.5, 1])
self.ROI.setAcceptedMouseButtons(QtCore.Qt.LeftButton)
parent.p0.addItem(self.ROI)