Merge pull request #1203 from meganbkratz/imageAxisOrder_bugfix
Image axis order bugfix
This commit is contained in:
commit
ffc271d6c7
@ -584,7 +584,7 @@ class ImageView(QtGui.QWidget):
|
|||||||
# Extract image data from ROI
|
# Extract image data from ROI
|
||||||
axes = (self.axes['x'], self.axes['y'])
|
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:
|
if data is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -592,7 +592,10 @@ class ImageView(QtGui.QWidget):
|
|||||||
if self.axes['t'] is None:
|
if self.axes['t'] is None:
|
||||||
# Average across y-axis of ROI
|
# Average across y-axis of ROI
|
||||||
data = data.mean(axis=axes[1])
|
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
|
xvals = (coords**2).sum(axis=0) ** 0.5
|
||||||
else:
|
else:
|
||||||
# Average data within entire ROI for each frame
|
# Average data within entire ROI for each frame
|
||||||
|
Loading…
Reference in New Issue
Block a user