From 748a8433b91178a269ca47598e9f59ae3937b56d Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Tue, 6 Sep 2016 17:46:52 -0700 Subject: [PATCH] minor edits --- pyqtgraph/functions.py | 7 +++++-- pyqtgraph/graphicsItems/ImageItem.py | 29 ++++------------------------ 2 files changed, 9 insertions(+), 27 deletions(-) diff --git a/pyqtgraph/functions.py b/pyqtgraph/functions.py index ad398079..9199fea7 100644 --- a/pyqtgraph/functions.py +++ b/pyqtgraph/functions.py @@ -1727,7 +1727,7 @@ def isosurface(data, level): See Paul Bourke, "Polygonising a Scalar Field" (http://paulbourke.net/geometry/polygonise/) - *data* 3D numpy array of scalar values + *data* 3D numpy array of scalar values. Must be contiguous. *level* The level at which to generate an isosurface Returns an array of vertex coordinates (Nv, 3) and an array of @@ -2079,7 +2079,10 @@ def isosurface(data, level): else: faceShiftTables, edgeShifts, edgeTable, nTableFaces = IsosurfaceDataCache - + # We use strides below, which means we need contiguous array input. + # Ideally we can fix this just by removing the dependency on strides. + if not data.flags['C_CONTIGUOUS']: + raise TypeError("isosurface input data must be c-contiguous.") ## mark everything below the isosurface level mask = data < level diff --git a/pyqtgraph/graphicsItems/ImageItem.py b/pyqtgraph/graphicsItems/ImageItem.py index 0bdf61ac..26897cf0 100644 --- a/pyqtgraph/graphicsItems/ImageItem.py +++ b/pyqtgraph/graphicsItems/ImageItem.py @@ -502,21 +502,6 @@ class ImageItem(GraphicsObject): self.qimage = None self.update() - #def mousePressEvent(self, ev): - #if self.drawKernel is not None and ev.button() == QtCore.Qt.LeftButton: - #self.drawAt(ev.pos(), ev) - #ev.accept() - #else: - #ev.ignore() - - #def mouseMoveEvent(self, ev): - ##print "mouse move", ev.pos() - #if self.drawKernel is not None: - #self.drawAt(ev.pos(), ev) - - #def mouseReleaseEvent(self, ev): - #pass - def mouseDragEvent(self, ev): if ev.button() != QtCore.Qt.LeftButton: ev.ignore() @@ -553,24 +538,18 @@ class ImageItem(GraphicsObject): self.menu.remAct = remAct return self.menu - def hoverEvent(self, ev): if not ev.isExit() and self.drawKernel is not None and ev.acceptDrags(QtCore.Qt.LeftButton): ev.acceptClicks(QtCore.Qt.LeftButton) ## we don't use the click, but we also don't want anyone else to use it. ev.acceptClicks(QtCore.Qt.RightButton) - #self.box.setBrush(fn.mkBrush('w')) elif not ev.isExit() and self.removable: ev.acceptClicks(QtCore.Qt.RightButton) ## accept context menu clicks - #else: - #self.box.setBrush(self.brush) - #self.update() - - def tabletEvent(self, ev): - print(ev.device()) - print(ev.pointerType()) - print(ev.pressure()) + pass + #print(ev.device()) + #print(ev.pointerType()) + #print(ev.pressure()) def drawAt(self, pos, ev=None): pos = [int(pos.x()), int(pos.y())]