diff --git a/pyqtgraph/graphicsItems/ROI.py b/pyqtgraph/graphicsItems/ROI.py index afa2a0ce7f..5774eccc43 100644 --- a/pyqtgraph/graphicsItems/ROI.py +++ b/pyqtgraph/graphicsItems/ROI.py @@ -105,6 +105,10 @@ class ROI(GraphicsObject): an option to remove the ROI. The ROI emits sigRemoveRequested when this menu action is selected. Default is False. + antialias (bool) If True, the ROI will render using AntiAliasing, + this is what is desired in almost all cases, the option is + added for testing purposes. + Default is True ================ =========================================================== @@ -143,7 +147,7 @@ def __init__(self, pos, size=Point(1, 1), angle=0.0, invertible=False, translateSnap=False, rotateSnap=False, parent=None, pen=None, hoverPen=None, handlePen=None, handleHoverPen=None, movable=True, rotatable=True, resizable=True, removable=False, - aspectLocked=False): + aspectLocked=False, antialias=True): GraphicsObject.__init__(self, parent) self.setAcceptedMouseButtons(QtCore.Qt.MouseButton.NoButton) pos = Point(pos) @@ -154,6 +158,7 @@ def __init__(self, pos, size=Point(1, 1), angle=0.0, invertible=False, self.resizable = resizable self.removable = removable self.menu = None + self._antialias = antialias self.freeHandleMoved = False ## keep track of whether free handles have moved since last change signal was emitted. self.mouseHovering = False @@ -611,7 +616,7 @@ def addHandle(self, info, index=None): ## If a Handle was not supplied, create it now if 'item' not in info or info['item'] is None: h = Handle(self.handleSize, typ=info['type'], pen=self.handlePen, - hoverPen=self.handleHoverPen, parent=self) + hoverPen=self.handleHoverPen, parent=self, antialias=self._antialias) info['item'] = h else: h = info['item'] @@ -1067,8 +1072,10 @@ def boundingRect(self): def paint(self, p, opt, widget): # Note: don't use self.boundingRect here, because subclasses may need to redefine it. r = QtCore.QRectF(0, 0, self.state['size'][0], self.state['size'][1]).normalized() - - p.setRenderHint(QtGui.QPainter.RenderHint.Antialiasing) + p.setRenderHint( + QtGui.QPainter.RenderHint.Antialiasing, + self._antialias + ) p.setPen(self.currentPen) p.translate(r.left(), r.top()) p.scale(r.width(), r.height()) @@ -1335,7 +1342,7 @@ class Handle(UIGraphicsItem): sigRemoveRequested = QtCore.Signal(object) # self def __init__(self, radius, typ=None, pen=(200, 200, 220), - hoverPen=(255, 255, 0), parent=None, deletable=False): + hoverPen=(255, 255, 0), parent=None, deletable=False, antialias=True): self.rois = [] self.radius = radius self.typ = typ @@ -1346,6 +1353,7 @@ def __init__(self, radius, typ=None, pen=(200, 200, 220), self.sides, self.startAng = self.types[typ] self.buildPath() self._shape = None + self._antialias = antialias self.menu = self.buildMenu() UIGraphicsItem.__init__(self, parent=parent) @@ -1477,9 +1485,11 @@ def buildPath(self): self.path.closeSubpath() def paint(self, p, opt, widget): - p.setRenderHints(p.RenderHint.Antialiasing, True) + p.setRenderHint( + p.RenderHint.Antialiasing, + self._antialias + ) p.setPen(self.currentPen) - p.drawPath(self.shape()) def shape(self): @@ -1488,7 +1498,9 @@ def shape(self): if s is None: return self.path self._shape = s - self.prepareGeometryChange() ## beware--this can cause the view to adjust, which would immediately invalidate the shape. + # beware--this can cause the view to adjust, + # which would immediately invalidate the shape. + self.prepareGeometryChange() return self._shape def boundingRect(self): @@ -1839,12 +1851,14 @@ def _clearPath(self): def paint(self, p, opt, widget): r = self.boundingRect() - p.setRenderHint(QtGui.QPainter.RenderHint.Antialiasing) + + p.setRenderHint( + QtGui.QPainter.RenderHint.Antialiasing, + self._antialias + ) p.setPen(self.currentPen) - p.scale(r.width(), r.height())## workaround for GL bug r = QtCore.QRectF(r.x()/r.width(), r.y()/r.height(), 1,1) - p.drawEllipse(r) def getArrayRegion(self, arr, img=None, axes=(0, 1), returnMappedCoords=False, **kwds): @@ -2017,7 +2031,7 @@ def setState(self, state): def addSegment(self, h1, h2, index=None): seg = _PolyLineSegment(handles=(h1, h2), pen=self.pen, hoverPen=self.hoverPen, - parent=self, movable=False) + parent=self, movable=False, antialias=self._antialias) if index is None: self.segments.append(seg) else: @@ -2162,7 +2176,10 @@ def setState(self, state): self.movePoint(self.getHandles()[1], p2) def paint(self, p, *args): - p.setRenderHint(QtGui.QPainter.RenderHint.Antialiasing) + p.setRenderHint( + QtGui.QPainter.RenderHint.Antialiasing, + self._antialias + ) p.setPen(self.currentPen) h1 = self.endpoints[0].pos() h2 = self.endpoints[1].pos() @@ -2278,9 +2295,11 @@ def shape(self): def paint(self, p, *args): radius = self.getState()['size'][1] - p.setRenderHint(QtGui.QPainter.RenderHint.Antialiasing) + p.setRenderHint( + QtGui.QPainter.RenderHint.Antialiasing, + self._antialias + ) p.setPen(self.currentPen) - p.drawLine(Point(0, -radius), Point(0, radius)) p.drawLine(Point(-radius, 0), Point(radius, 0)) @@ -2337,7 +2356,10 @@ def __init__(self, pos, size, **args): def paint(self, p, *args): r = self.boundingRect() - p.setRenderHint(QtGui.QPainter.RenderHint.Antialiasing) + p.setRenderHint( + QtGui.QPainter.RenderHint.Antialiasing, + self._antialias + ) p.scale(r.width(), r.height()) p.setPen(self.currentPen) p.drawPolygon(self.poly) diff --git a/tests/graphicsItems/test_ROI.py b/tests/graphicsItems/test_ROI.py index 89a4f82bcb..5bcb75cf9d 100644 --- a/tests/graphicsItems/test_ROI.py +++ b/tests/graphicsItems/test_ROI.py @@ -14,52 +14,55 @@ pg.setConfigOption("mouseRateLimit", 0) -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'), +@pytest.mark.parametrize("roi, name", [ + (pg.ROI([1, 1], [27, 28], pen='y', antialias=False), 'baseroi'), + (pg.RectROI([1, 1], [27, 28], pen='y', antialias=False), 'rectroi'), + (pg.EllipseROI([1, 1], [27, 28], pen='y', antialias=False), 'ellipseroi'), + ( + pg.PolyLineROI( + [[0, 0], [27, 0], [0, 28]], + closed=True, + pos=(1, 1), + antialias=False + ),'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) - - -def test_getArrayRegion_axisorder(): - test_getArrayRegion(transpose=True) +) +@pytest.mark.parametrize("transpose", [True, False]) +def test_getArrayRegion(roi, name, transpose): + # For some ROIs, resize should not be used. + testResize = not isinstance(roi, pg.PolyLineROI) + + origMode = pg.getConfigOption('imageAxisOrder') + try: + pg.setConfigOptions( + imageAxisOrder='row-major' if transpose else 'col-major' + ) + check_getArrayRegion( + roi, f"roi/{name}", + testResize, + transpose=transpose + ) + finally: + pg.setConfigOptions(imageAxisOrder=origMode) def check_getArrayRegion(roi, name, testResize=True, transpose=False): - # on windows, edges corner pixels seem to be slightly different from - # other platforms giving a pxCount=2 for a fudge factor - if (isinstance(roi, (pg.ROI, pg.RectROI)) - and platform.system() == "Windows"): - pxCount = 2 + # edges corner pixels seem to be slightly different on windows + if ( + isinstance(roi, (pg.ROI, pg.RectROI)) + and platform.system() == "Windows" + ): + pxCount = 1 else: pxCount = -1 initState = roi.getState() - win = pg.GraphicsView() win.show() resizeWindow(win, 200, 400) # Don't use Qt's layouts for testing--these generate unpredictable results. - # Instead, place the viewboxes manually + # Instead, manually place the ViewBoxes vb1 = pg.ViewBox() win.scene().addItem(vb1) vb1.setPos(6, 6) @@ -94,12 +97,13 @@ def check_getArrayRegion(roi, name, testResize=True, transpose=False): vb1.addItem(roi) if isinstance(roi, pg.RectROI): - if transpose: - assert roi.getAffineSliceParams(data, img1, axes=(1, 2)) == ( - [28.0, 27.0], ((1.0, 0.0), (0.0, 1.0)), (1.0, 1.0)) - else: - assert roi.getAffineSliceParams(data, img1, axes=(1, 2)) == ( - [27.0, 28.0], ((1.0, 0.0), (0.0, 1.0)), (1.0, 1.0)) + first_arg = [28.0, 27.0] if transpose else [27.0, 28.0] + assert roi.getAffineSliceParams( + data, + img1, + axes=(1, 2) + ) == (first_arg, ((1.0, 0.0), (0.0, 1.0)), (1.0, 1.0)) + rgn = roi.getArrayRegion(data, img1, axes=(1, 2)) # assert np.all((rgn == data[:, 1:-2, 1:-2, :]) | (rgn == 0)) @@ -108,8 +112,12 @@ def check_getArrayRegion(roi, name, testResize=True, transpose=False): vb2.enableAutoRange(True, True) app.processEvents() - assertImageApproved(win, name + '/roi_getarrayregion', - 'Simple ROI region selection.', pxCount=pxCount) + assertImageApproved( + win, + f'{name}/roi_getarrayregion', + 'Simple ROI region selection.', + pxCount=pxCount + ) with pytest.raises(TypeError): roi.setPos(0, False) @@ -118,44 +126,59 @@ def check_getArrayRegion(roi, name, testResize=True, transpose=False): rgn = roi.getArrayRegion(data, img1, axes=(1, 2)) img2.setImage(rgn[0, ..., 0]) app.processEvents() - assertImageApproved(win, name + '/roi_getarrayregion_halfpx', - 'Simple ROI region selection, 0.5 pixel shift.', - pxCount=pxCount) + assertImageApproved( + win, + f'{name}/roi_getarrayregion_halfpx', + 'Simple ROI region selection, 0.5 pixel shift.', + pxCount=pxCount + ) roi.setAngle(45) roi.setPos([3, 0]) rgn = roi.getArrayRegion(data, img1, axes=(1, 2)) img2.setImage(rgn[0, ..., 0]) app.processEvents() - assertImageApproved(win, name + '/roi_getarrayregion_rotate', - 'Simple ROI region selection, rotation.', - pxCount=pxCount) + assertImageApproved( + win, + f'{name}/roi_getarrayregion_rotate', + 'Simple ROI region selection, rotation.', + pxCount=pxCount + ) if testResize: roi.setSize([60, 60]) rgn = roi.getArrayRegion(data, img1, axes=(1, 2)) img2.setImage(rgn[0, ..., 0]) app.processEvents() - assertImageApproved(win, name + '/roi_getarrayregion_resize', - 'Simple ROI region selection, resized.', - pxCount=pxCount) + assertImageApproved( + win, + f'{name}/roi_getarrayregion_resize', + 'Simple ROI region selection, resized.', + pxCount=pxCount + ) img1.setPos(0, img1.height()) img1.setTransform(QtGui.QTransform().scale(1, -1).rotate(20), True) rgn = roi.getArrayRegion(data, img1, axes=(1, 2)) img2.setImage(rgn[0, ..., 0]) app.processEvents() - assertImageApproved(win, name + '/roi_getarrayregion_img_trans', - 'Simple ROI region selection, image transformed.', - pxCount=pxCount) + assertImageApproved( + win, + f'{name}/roi_getarrayregion_img_trans', + 'Simple ROI region selection, image transformed.', + pxCount=pxCount + ) vb1.invertY() rgn = roi.getArrayRegion(data, img1, axes=(1, 2)) img2.setImage(rgn[0, ..., 0]) app.processEvents() - assertImageApproved(win, name + '/roi_getarrayregion_inverty', - 'Simple ROI region selection, view inverted.', - pxCount=pxCount) + assertImageApproved( + win, + f'{name}/roi_getarrayregion_inverty', + 'Simple ROI region selection, view inverted.', + pxCount=pxCount + ) roi.setState(initState) img1.setPos(0, 0) @@ -164,13 +187,13 @@ def check_getArrayRegion(roi, name, testResize=True, transpose=False): img2.setImage(rgn[0, ..., 0]) app.processEvents() assertImageApproved( - win, name + '/roi_getarrayregion_anisotropic', + win, + f'{name}/roi_getarrayregion_anisotropic', 'Simple ROI region selection, image scaled anisotropically.', - pxCount=pxCount) - + pxCount=pxCount + ) # allow the roi to be re-used roi.scene().removeItem(roi) - win.hide() @@ -188,11 +211,15 @@ def test_mouseClickEvent(): vb.addItem(roi) app.processEvents() - mouseClick(plt, roi.mapToScene(pg.Point(2, 2)), - QtCore.Qt.MouseButton.LeftButton) + mouseClick( + plt, + roi.mapToScene(pg.Point(2, 2)), + QtCore.Qt.MouseButton.LeftButton + ) def test_mouseDragEventSnap(): + pg.setConfigOptions(antialias=False) plt = pg.GraphicsView() plt.show() resizeWindow(plt, 200, 200) @@ -205,8 +232,14 @@ def test_mouseDragEventSnap(): # A Rectangular roi with scaleSnap enabled initial_x = 20 initial_y = 20 - roi = pg.RectROI((initial_x, initial_y), (20, 20), scaleSnap=True, - translateSnap=True, snapSize=1.0, movable=True) + roi = pg.RectROI( + (initial_x, initial_y), + (20, 20), + scaleSnap=True, + translateSnap=True, + snapSize=1.0, + movable=True + ) vb.addItem(roi) app.processEvents() @@ -223,28 +256,53 @@ def test_mouseDragEventSnap(): # Only drag in y direction roi_position = roi.mapToView(pg.Point(initial_x, initial_y)) - mouseDrag(plt, roi_position, roi_position + pg.Point(0, 10), - QtCore.Qt.MouseButton.LeftButton) + mouseDrag( + plt, + roi_position, + roi_position + pg.Point(0, 10), + QtCore.Qt.MouseButton.LeftButton + ) assert roi.pos() == pg.Point(initial_x, 19) - mouseDrag(plt, roi_position, roi_position + pg.Point(0, 10), - QtCore.Qt.MouseButton.LeftButton) + mouseDrag( + plt, + roi_position, + roi_position + pg.Point(0, 10), + QtCore.Qt.MouseButton.LeftButton + ) assert roi.pos() == pg.Point(initial_x, 18) # Only drag in x direction - mouseDrag(plt, roi_position, roi_position + pg.Point(10, 0), - QtCore.Qt.MouseButton.LeftButton) + mouseDrag( + plt, + roi_position, + roi_position + pg.Point(10, 0), + QtCore.Qt.MouseButton.LeftButton + ) assert roi.pos() == pg.Point(21, 18) - -def test_PolyLineROI(): - rois = [ - (pg.PolyLineROI([[0, 0], [10, 0], [0, 15]], closed=True, pen=0.3), - 'closed'), - (pg.PolyLineROI([[0, 0], [10, 0], [0, 15]], closed=False, pen=0.3), - 'open') +@pytest.mark.parametrize("roi, name", [ + ( + pg.PolyLineROI( + [[0, 0], [10, 0], [0, 15]], + closed=True, + pen=0.3, + antialias=False + ), + 'closed' + ), + ( + pg.PolyLineROI( + [[0, 0], [10, 0], [0, 15]], + closed=False, + pen=0.3, + antialias=False + ), + 'open' + ) ] - +) +def test_PolyLineROI(roi, name): plt = pg.GraphicsView() plt.show() resizeWindow(plt, 200, 200) @@ -262,84 +320,130 @@ def test_PolyLineROI(): QtTest.QTest.qWaitForWindowExposed(plt) QtTest.QTest.qWait(100) - for r, name in rois: - vb.clear() - vb.addItem(r) - vb.autoRange() - app.processEvents() + vb.clear() + vb.addItem(roi) + vb.autoRange() + app.processEvents() - assertImageApproved(plt, 'roi/polylineroi/' + name + '_init', - 'Init %s polyline.' % name) - initState = r.getState() - assert len(r.getState()['points']) == 3 - - # hover over center - center = r.mapToScene(pg.Point(3, 3)) - mouseMove(plt, center) - assertImageApproved(plt, 'roi/polylineroi/' + name + '_hover_roi', - 'Hover mouse over center of ROI.') - - # drag ROI - mouseDrag(plt, center, center + pg.Point(10, -10), - QtCore.Qt.MouseButton.LeftButton) - assertImageApproved(plt, 'roi/polylineroi/' + name + '_drag_roi', - 'Drag mouse over center of ROI.') - - # hover over handle - pt = r.mapToScene(pg.Point(r.getState()['points'][2])) - mouseMove(plt, pt) - assertImageApproved(plt, 'roi/polylineroi/' + name + '_hover_handle', - 'Hover mouse over handle.') - - # drag handle - mouseDrag(plt, pt, pt + pg.Point(5, 20), - QtCore.Qt.MouseButton.LeftButton) - assertImageApproved(plt, 'roi/polylineroi/' + name + '_drag_handle', - 'Drag mouse over handle.') - - # hover over segment - pt = r.mapToScene((pg.Point(r.getState()['points'][2]) + pg.Point( - r.getState()['points'][1])) * 0.5) - mouseMove(plt, pt + pg.Point(0, 2)) - assertImageApproved(plt, 'roi/polylineroi/' + name + '_hover_segment', - 'Hover mouse over diagonal segment.') - - # click segment - mouseClick(plt, pt, QtCore.Qt.MouseButton.LeftButton) - assertImageApproved(plt, 'roi/polylineroi/' + name + '_click_segment', - 'Click mouse over segment.') - - # drag new handle - mouseMove(plt, pt + pg.Point(10, - -10)) - # pg bug: have to move the mouse off/on again to register hover - mouseDrag(plt, pt, pt + pg.Point(10, -10), - QtCore.Qt.MouseButton.LeftButton) - assertImageApproved(plt, - 'roi/polylineroi/' + name + '_drag_new_handle', - 'Drag mouse over created handle.') - - # clear all points - r.clearPoints() - assertImageApproved(plt, 'roi/polylineroi/' + name + '_clear', - 'All points cleared.') - assert len(r.getState()['points']) == 0 - - # call setPoints - r.setPoints(initState['points']) - assertImageApproved( - plt, - f'roi/polylineroi/{name}_setpoints', - 'Reset points to initial state.', - pxCount=1 if platform.system() == "Darwin" and parse(platform.mac_ver()[0]) >= Version("13.0") else 0 - ) - assert len(r.getState()['points']) == 3 + assertImageApproved( + plt, + f'roi/polylineroi/{name}_init', + f'Init {name} polyline.' + ) + initState = roi.getState() + assert len(roi.getState()['points']) == 3 + + # hover over center + center = roi.mapToScene(pg.Point(3, 3)) + mouseMove(plt, center) + assertImageApproved( + plt, + f'roi/polylineroi/{name}_hover_roi', + 'Hover mouse over center of ROI.' + ) + + # drag ROI + mouseDrag( + plt, + center, center + pg.Point(10, -10), + QtCore.Qt.MouseButton.LeftButton + ) + assertImageApproved( + plt, + f'roi/polylineroi/{name}_drag_roi', + 'Drag mouse over center of ROI.' + ) + + # hover over handle + pt = roi.mapToScene( + pg.Point(roi.getState()['points'][2]) + ) + mouseMove(plt, pt) + assertImageApproved( + plt, + f'roi/polylineroi/{name}_hover_handle', + 'Hover mouse over handle.' + ) + + # drag handle + mouseDrag(plt, + pt, + pt + pg.Point(5, 20), + QtCore.Qt.MouseButton.LeftButton + ) + + assertImageApproved( + plt, + f'roi/polylineroi/{name}_drag_handle', + 'Drag mouse over handle.' + ) + + # hover over segment + pt = roi.mapToScene( + ( + pg.Point(roi.getState()['points'][2]) + + pg.Point(roi.getState()['points'][1]) + ) * 0.5 + ) + + mouseMove(plt, pt + pg.Point(0, 2)) + assertImageApproved( + plt, + f'roi/polylineroi/{name}_hover_segment', + 'Hover mouse over diagonal segment.' + ) + + # click segment + mouseClick(plt, pt, QtCore.Qt.MouseButton.LeftButton) + assertImageApproved( + plt, + f'roi/polylineroi/{name}_click_segment', + 'Click mouse over segment.', + pxCount=3 + ) + + # drag new handle + mouseMove(plt, pt + pg.Point(10, -10)) + # pg bug: have to move the mouse off/on again to register hover + mouseDrag( + plt, + pt, pt + pg.Point(10, -10), + QtCore.Qt.MouseButton.LeftButton + ) + + assertImageApproved( + plt, + f'roi/polylineroi/{name}_drag_new_handle', + 'Drag mouse over created handle.', + pxCount=2 + ) + + # clear all points + roi.clearPoints() + assertImageApproved( + plt, + f'roi/polylineroi/{name}_clear', + 'All points cleared.' + ) + assert len(roi.getState()['points']) == 0 + + # call setPoints + roi.setPoints(initState['points']) + assertImageApproved( + plt, + f'roi/polylineroi/{name}_setpoints', + 'Reset points to initial state.', + ) + assert len(roi.getState()['points']) == 3 - # call setState - r.setState(initState) - assertImageApproved(plt, 'roi/polylineroi/' + name + '_setstate', - 'Reset ROI to initial state.') - assert len(r.getState()['points']) == 3 + # call setState + roi.setState(initState) + assertImageApproved( + plt, + f'roi/polylineroi/{name}_setstate', + 'Reset ROI to initial state.' + ) + assert len(roi.getState()['points']) == 3 plt.hide() @@ -351,6 +455,7 @@ def test_PolyLineROI(): ((-2, 1), (-4, -8)), ]) def test_LineROI_coords(p1, p2): + pg.setConfigOptions(antialias=False) pw = pg.PlotWidget() pw.show() @@ -358,8 +463,10 @@ def test_LineROI_coords(p1, p2): pw.addItem(lineroi) # first two handles are the scale-rotate handles positioned by pos1, pos2 - for expected, (name, scenepos) in zip([p1, p2], - lineroi.getSceneHandlePositions()): + for expected, (_, scenepos) in zip( + [p1, p2], + lineroi.getSceneHandlePositions() + ): got = lineroi.mapSceneToParent(scenepos) assert math.isclose(got.x(), expected[0]) assert math.isclose(got.y(), expected[1]) diff --git a/tests/image_testing.py b/tests/image_testing.py index afa044e6cc..d02127e492 100644 --- a/tests/image_testing.py +++ b/tests/image_testing.py @@ -223,7 +223,7 @@ def assertImageMatch(im1, im2, minCorr=None, pxThreshold=50., pxdiff = diff.max(axis=2) # largest value difference per pixel mask = np.abs(pxdiff) >= pxThreshold if pxCount is not None: - assert mask.sum() <= pxCount + assert mask.sum() <= pxCount, f"allowed {pxCount=}, actual was {mask.sum()}" maskedDiff = diff[mask] if maxPxDiff is not None and maskedDiff.size > 0: diff --git a/tests/images/roi/baseroi/roi_getarrayregion.png b/tests/images/roi/baseroi/roi_getarrayregion.png index 440ebfdc8a..a4031ac459 100644 Binary files a/tests/images/roi/baseroi/roi_getarrayregion.png and b/tests/images/roi/baseroi/roi_getarrayregion.png differ diff --git a/tests/images/roi/baseroi/roi_getarrayregion_anisotropic.png b/tests/images/roi/baseroi/roi_getarrayregion_anisotropic.png index ad0eaf2c6f..925f5218d6 100644 Binary files a/tests/images/roi/baseroi/roi_getarrayregion_anisotropic.png and b/tests/images/roi/baseroi/roi_getarrayregion_anisotropic.png differ diff --git a/tests/images/roi/baseroi/roi_getarrayregion_halfpx.png b/tests/images/roi/baseroi/roi_getarrayregion_halfpx.png index e64976aef3..00d34ee94c 100644 Binary files a/tests/images/roi/baseroi/roi_getarrayregion_halfpx.png and b/tests/images/roi/baseroi/roi_getarrayregion_halfpx.png differ diff --git a/tests/images/roi/baseroi/roi_getarrayregion_img_trans.png b/tests/images/roi/baseroi/roi_getarrayregion_img_trans.png index e59ddec78f..819e607506 100644 Binary files a/tests/images/roi/baseroi/roi_getarrayregion_img_trans.png and b/tests/images/roi/baseroi/roi_getarrayregion_img_trans.png differ diff --git a/tests/images/roi/baseroi/roi_getarrayregion_inverty.png b/tests/images/roi/baseroi/roi_getarrayregion_inverty.png index a97fd068bd..aee5254aad 100644 Binary files a/tests/images/roi/baseroi/roi_getarrayregion_inverty.png and b/tests/images/roi/baseroi/roi_getarrayregion_inverty.png differ diff --git a/tests/images/roi/baseroi/roi_getarrayregion_resize.png b/tests/images/roi/baseroi/roi_getarrayregion_resize.png index 5e82196d9a..60a206b947 100644 Binary files a/tests/images/roi/baseroi/roi_getarrayregion_resize.png and b/tests/images/roi/baseroi/roi_getarrayregion_resize.png differ diff --git a/tests/images/roi/baseroi/roi_getarrayregion_rotate.png b/tests/images/roi/baseroi/roi_getarrayregion_rotate.png index eff9c64fca..7a59908a47 100644 Binary files a/tests/images/roi/baseroi/roi_getarrayregion_rotate.png and b/tests/images/roi/baseroi/roi_getarrayregion_rotate.png differ diff --git a/tests/images/roi/ellipseroi/roi_getarrayregion.png b/tests/images/roi/ellipseroi/roi_getarrayregion.png index 8bb1cfc7c3..91a0514ad2 100644 Binary files a/tests/images/roi/ellipseroi/roi_getarrayregion.png and b/tests/images/roi/ellipseroi/roi_getarrayregion.png differ diff --git a/tests/images/roi/ellipseroi/roi_getarrayregion_anisotropic.png b/tests/images/roi/ellipseroi/roi_getarrayregion_anisotropic.png index 1601298f1a..6a48b12b9d 100644 Binary files a/tests/images/roi/ellipseroi/roi_getarrayregion_anisotropic.png and b/tests/images/roi/ellipseroi/roi_getarrayregion_anisotropic.png differ diff --git a/tests/images/roi/ellipseroi/roi_getarrayregion_halfpx.png b/tests/images/roi/ellipseroi/roi_getarrayregion_halfpx.png index 88165740a6..36e6c08764 100644 Binary files a/tests/images/roi/ellipseroi/roi_getarrayregion_halfpx.png and b/tests/images/roi/ellipseroi/roi_getarrayregion_halfpx.png differ diff --git a/tests/images/roi/ellipseroi/roi_getarrayregion_img_trans.png b/tests/images/roi/ellipseroi/roi_getarrayregion_img_trans.png index 9ba008c77b..4ae9888972 100644 Binary files a/tests/images/roi/ellipseroi/roi_getarrayregion_img_trans.png and b/tests/images/roi/ellipseroi/roi_getarrayregion_img_trans.png differ diff --git a/tests/images/roi/ellipseroi/roi_getarrayregion_inverty.png b/tests/images/roi/ellipseroi/roi_getarrayregion_inverty.png index 2b5b9703b1..9e54fdf37b 100644 Binary files a/tests/images/roi/ellipseroi/roi_getarrayregion_inverty.png and b/tests/images/roi/ellipseroi/roi_getarrayregion_inverty.png differ diff --git a/tests/images/roi/ellipseroi/roi_getarrayregion_resize.png b/tests/images/roi/ellipseroi/roi_getarrayregion_resize.png index 604d733c75..c1604d48d8 100644 Binary files a/tests/images/roi/ellipseroi/roi_getarrayregion_resize.png and b/tests/images/roi/ellipseroi/roi_getarrayregion_resize.png differ diff --git a/tests/images/roi/ellipseroi/roi_getarrayregion_rotate.png b/tests/images/roi/ellipseroi/roi_getarrayregion_rotate.png index 1f806959b3..f090e5cb27 100644 Binary files a/tests/images/roi/ellipseroi/roi_getarrayregion_rotate.png and b/tests/images/roi/ellipseroi/roi_getarrayregion_rotate.png differ diff --git a/tests/images/roi/polylineroi/closed_click_segment.png b/tests/images/roi/polylineroi/closed_click_segment.png index dba7d2cc0c..94c27ff2d7 100644 Binary files a/tests/images/roi/polylineroi/closed_click_segment.png and b/tests/images/roi/polylineroi/closed_click_segment.png differ diff --git a/tests/images/roi/polylineroi/closed_drag_handle.png b/tests/images/roi/polylineroi/closed_drag_handle.png index 4a635d4617..c5cc3f0434 100644 Binary files a/tests/images/roi/polylineroi/closed_drag_handle.png and b/tests/images/roi/polylineroi/closed_drag_handle.png differ diff --git a/tests/images/roi/polylineroi/closed_drag_new_handle.png b/tests/images/roi/polylineroi/closed_drag_new_handle.png index ac08eac376..a1857a76a6 100644 Binary files a/tests/images/roi/polylineroi/closed_drag_new_handle.png and b/tests/images/roi/polylineroi/closed_drag_new_handle.png differ diff --git a/tests/images/roi/polylineroi/closed_drag_roi.png b/tests/images/roi/polylineroi/closed_drag_roi.png index 9094dca28e..5e59a91c98 100644 Binary files a/tests/images/roi/polylineroi/closed_drag_roi.png and b/tests/images/roi/polylineroi/closed_drag_roi.png differ diff --git a/tests/images/roi/polylineroi/closed_hover_handle.png b/tests/images/roi/polylineroi/closed_hover_handle.png index c596eb237e..3b8fe3506e 100644 Binary files a/tests/images/roi/polylineroi/closed_hover_handle.png and b/tests/images/roi/polylineroi/closed_hover_handle.png differ diff --git a/tests/images/roi/polylineroi/closed_hover_roi.png b/tests/images/roi/polylineroi/closed_hover_roi.png index e535773334..ee5bd8bdca 100644 Binary files a/tests/images/roi/polylineroi/closed_hover_roi.png and b/tests/images/roi/polylineroi/closed_hover_roi.png differ diff --git a/tests/images/roi/polylineroi/closed_hover_segment.png b/tests/images/roi/polylineroi/closed_hover_segment.png index ff15e5822e..2fc130442a 100644 Binary files a/tests/images/roi/polylineroi/closed_hover_segment.png and b/tests/images/roi/polylineroi/closed_hover_segment.png differ diff --git a/tests/images/roi/polylineroi/closed_init.png b/tests/images/roi/polylineroi/closed_init.png index e99a6c58d8..f16ffb8509 100644 Binary files a/tests/images/roi/polylineroi/closed_init.png and b/tests/images/roi/polylineroi/closed_init.png differ diff --git a/tests/images/roi/polylineroi/closed_setpoints.png b/tests/images/roi/polylineroi/closed_setpoints.png index 2f31114019..155fa3e1ba 100644 Binary files a/tests/images/roi/polylineroi/closed_setpoints.png and b/tests/images/roi/polylineroi/closed_setpoints.png differ diff --git a/tests/images/roi/polylineroi/closed_setstate.png b/tests/images/roi/polylineroi/closed_setstate.png index e99a6c58d8..f16ffb8509 100644 Binary files a/tests/images/roi/polylineroi/closed_setstate.png and b/tests/images/roi/polylineroi/closed_setstate.png differ diff --git a/tests/images/roi/polylineroi/open_click_segment.png b/tests/images/roi/polylineroi/open_click_segment.png index f99e663a00..f715169c76 100644 Binary files a/tests/images/roi/polylineroi/open_click_segment.png and b/tests/images/roi/polylineroi/open_click_segment.png differ diff --git a/tests/images/roi/polylineroi/open_drag_handle.png b/tests/images/roi/polylineroi/open_drag_handle.png index 50cfeed514..dc0f033bb7 100644 Binary files a/tests/images/roi/polylineroi/open_drag_handle.png and b/tests/images/roi/polylineroi/open_drag_handle.png differ diff --git a/tests/images/roi/polylineroi/open_drag_new_handle.png b/tests/images/roi/polylineroi/open_drag_new_handle.png index f2aad0a708..db223a9605 100644 Binary files a/tests/images/roi/polylineroi/open_drag_new_handle.png and b/tests/images/roi/polylineroi/open_drag_new_handle.png differ diff --git a/tests/images/roi/polylineroi/open_drag_roi.png b/tests/images/roi/polylineroi/open_drag_roi.png index a3fe2d6a5d..12466d02aa 100644 Binary files a/tests/images/roi/polylineroi/open_drag_roi.png and b/tests/images/roi/polylineroi/open_drag_roi.png differ diff --git a/tests/images/roi/polylineroi/open_hover_handle.png b/tests/images/roi/polylineroi/open_hover_handle.png index 93f0f786a8..a2e13ac6a2 100644 Binary files a/tests/images/roi/polylineroi/open_hover_handle.png and b/tests/images/roi/polylineroi/open_hover_handle.png differ diff --git a/tests/images/roi/polylineroi/open_hover_roi.png b/tests/images/roi/polylineroi/open_hover_roi.png index 23edb1967a..4c9851b263 100644 Binary files a/tests/images/roi/polylineroi/open_hover_roi.png and b/tests/images/roi/polylineroi/open_hover_roi.png differ diff --git a/tests/images/roi/polylineroi/open_hover_segment.png b/tests/images/roi/polylineroi/open_hover_segment.png index 53c6df6c53..61a4090676 100644 Binary files a/tests/images/roi/polylineroi/open_hover_segment.png and b/tests/images/roi/polylineroi/open_hover_segment.png differ diff --git a/tests/images/roi/polylineroi/open_init.png b/tests/images/roi/polylineroi/open_init.png index 38cf15d6a4..884f007086 100644 Binary files a/tests/images/roi/polylineroi/open_init.png and b/tests/images/roi/polylineroi/open_init.png differ diff --git a/tests/images/roi/polylineroi/open_setpoints.png b/tests/images/roi/polylineroi/open_setpoints.png index 5c2d59310d..800464864a 100644 Binary files a/tests/images/roi/polylineroi/open_setpoints.png and b/tests/images/roi/polylineroi/open_setpoints.png differ diff --git a/tests/images/roi/polylineroi/open_setstate.png b/tests/images/roi/polylineroi/open_setstate.png index 38cf15d6a4..884f007086 100644 Binary files a/tests/images/roi/polylineroi/open_setstate.png and b/tests/images/roi/polylineroi/open_setstate.png differ diff --git a/tests/images/roi/polylineroi/roi_getarrayregion.png b/tests/images/roi/polylineroi/roi_getarrayregion.png index bbf424e4eb..77e4166db7 100644 Binary files a/tests/images/roi/polylineroi/roi_getarrayregion.png and b/tests/images/roi/polylineroi/roi_getarrayregion.png differ diff --git a/tests/images/roi/polylineroi/roi_getarrayregion_anisotropic.png b/tests/images/roi/polylineroi/roi_getarrayregion_anisotropic.png index 1900907149..650b0f6630 100644 Binary files a/tests/images/roi/polylineroi/roi_getarrayregion_anisotropic.png and b/tests/images/roi/polylineroi/roi_getarrayregion_anisotropic.png differ diff --git a/tests/images/roi/polylineroi/roi_getarrayregion_halfpx.png b/tests/images/roi/polylineroi/roi_getarrayregion_halfpx.png index f5af5fc3c3..1cce4fb857 100644 Binary files a/tests/images/roi/polylineroi/roi_getarrayregion_halfpx.png and b/tests/images/roi/polylineroi/roi_getarrayregion_halfpx.png differ diff --git a/tests/images/roi/polylineroi/roi_getarrayregion_img_trans.png b/tests/images/roi/polylineroi/roi_getarrayregion_img_trans.png index b3cf8a1c66..96e9f8e255 100644 Binary files a/tests/images/roi/polylineroi/roi_getarrayregion_img_trans.png and b/tests/images/roi/polylineroi/roi_getarrayregion_img_trans.png differ diff --git a/tests/images/roi/polylineroi/roi_getarrayregion_inverty.png b/tests/images/roi/polylineroi/roi_getarrayregion_inverty.png index 004662962c..a84029bba5 100644 Binary files a/tests/images/roi/polylineroi/roi_getarrayregion_inverty.png and b/tests/images/roi/polylineroi/roi_getarrayregion_inverty.png differ diff --git a/tests/images/roi/polylineroi/roi_getarrayregion_rotate.png b/tests/images/roi/polylineroi/roi_getarrayregion_rotate.png index 7961c675db..55485217dd 100644 Binary files a/tests/images/roi/polylineroi/roi_getarrayregion_rotate.png and b/tests/images/roi/polylineroi/roi_getarrayregion_rotate.png differ diff --git a/tests/images/roi/rectroi/roi_getarrayregion.png b/tests/images/roi/rectroi/roi_getarrayregion.png index 13b308e7ae..a29e9db0f4 100644 Binary files a/tests/images/roi/rectroi/roi_getarrayregion.png and b/tests/images/roi/rectroi/roi_getarrayregion.png differ diff --git a/tests/images/roi/rectroi/roi_getarrayregion_anisotropic.png b/tests/images/roi/rectroi/roi_getarrayregion_anisotropic.png index 8d0a825fbf..6a14163856 100644 Binary files a/tests/images/roi/rectroi/roi_getarrayregion_anisotropic.png and b/tests/images/roi/rectroi/roi_getarrayregion_anisotropic.png differ diff --git a/tests/images/roi/rectroi/roi_getarrayregion_halfpx.png b/tests/images/roi/rectroi/roi_getarrayregion_halfpx.png index 956796d092..312b4943a3 100644 Binary files a/tests/images/roi/rectroi/roi_getarrayregion_halfpx.png and b/tests/images/roi/rectroi/roi_getarrayregion_halfpx.png differ diff --git a/tests/images/roi/rectroi/roi_getarrayregion_img_trans.png b/tests/images/roi/rectroi/roi_getarrayregion_img_trans.png index 7a12ba7a99..6bbc4554ee 100644 Binary files a/tests/images/roi/rectroi/roi_getarrayregion_img_trans.png and b/tests/images/roi/rectroi/roi_getarrayregion_img_trans.png differ diff --git a/tests/images/roi/rectroi/roi_getarrayregion_inverty.png b/tests/images/roi/rectroi/roi_getarrayregion_inverty.png index 8a801f78f5..83ed514fbf 100644 Binary files a/tests/images/roi/rectroi/roi_getarrayregion_inverty.png and b/tests/images/roi/rectroi/roi_getarrayregion_inverty.png differ diff --git a/tests/images/roi/rectroi/roi_getarrayregion_resize.png b/tests/images/roi/rectroi/roi_getarrayregion_resize.png index 881517fe91..a6afd07a31 100644 Binary files a/tests/images/roi/rectroi/roi_getarrayregion_resize.png and b/tests/images/roi/rectroi/roi_getarrayregion_resize.png differ diff --git a/tests/images/roi/rectroi/roi_getarrayregion_rotate.png b/tests/images/roi/rectroi/roi_getarrayregion_rotate.png index 366e1f9ce1..2f2ebbb6eb 100644 Binary files a/tests/images/roi/rectroi/roi_getarrayregion_rotate.png and b/tests/images/roi/rectroi/roi_getarrayregion_rotate.png differ