diff --git a/pyqtgraph/imageview/ImageView.py b/pyqtgraph/imageview/ImageView.py index e9058bdb..546d4164 100644 --- a/pyqtgraph/imageview/ImageView.py +++ b/pyqtgraph/imageview/ImageView.py @@ -584,7 +584,7 @@ class ImageView(QtGui.QWidget): # Extract image data from ROI axes = (self.axes['x'], self.axes['y']) - data, coords = self.roi.getArrayRegion(image.view(np.ndarray), self.imageItem, axes, returnMappedCoords=True) + data, coords = self.roi.getArrayRegion(image.view(np.ndarray), self.imageItem, returnMappedCoords=True) if data is None: return @@ -592,7 +592,10 @@ 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 == (1,0): ## we're in row-major order mode -- there's probably a better way to do this slicing dynamically, but I've not figured it out yet. + coords = coords[:,0,:] - coords[:,0,0:1] + else: #default to old way + coords = coords[:,:,0] - coords[:,0:1,0] xvals = (coords**2).sum(axis=0) ** 0.5 else: # Average data within entire ROI for each frame