Merge pull request #1203 from meganbkratz/imageAxisOrder_bugfix

Image axis order bugfix
This commit is contained in:
Ogi Moore 2020-06-05 21:36:00 -07:00 committed by GitHub
commit ffc271d6c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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