From 360bcad47b2c25ae2c7cffb8958bb97953b016db Mon Sep 17 00:00:00 2001 From: Megan Kratz Date: Tue, 19 May 2020 15:12:09 -0600 Subject: [PATCH] fix for mismatched axis exception when imageAxisOrder='row-major' --- pyqtgraph/imageview/ImageView.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pyqtgraph/imageview/ImageView.py b/pyqtgraph/imageview/ImageView.py index c3878afd..8809def9 100644 --- a/pyqtgraph/imageview/ImageView.py +++ b/pyqtgraph/imageview/ImageView.py @@ -595,7 +595,13 @@ class ImageView(QtGui.QWidget): if self.axes['t'] is None: # Average across y-axis of ROI data = data.mean(axis=axes[1]) - coords = coords[:,:,0] - coords[:,0:1,0] + + if axes == (0,1): ## there's probably a better way to do this slicing dynamically, but I'm not sure what it is. + coords = coords[:,:,0] - coords[:,0:1,0] + elif axes == (1,0): ## we're in row-major order mode + coords = coords[:,0,:] - coords[:,0,0:1] + else: + raise Exception("Need to implement a better way to handle these axes: %s" %str(self.axes)) xvals = (coords**2).sum(axis=0) ** 0.5 else: # Average data within entire ROI for each frame