mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-09 22:07:27 +08:00
ENH: Cast arrays for numpy compatibility.
The casting rules in newer versions of numpy are stricter, so ensure that we have a compatible data type.
This commit is contained in:
@@ -124,16 +124,16 @@ class ImageViewer(QMainWindow):
|
||||
io.imsave(self.image, filename)
|
||||
else:
|
||||
im1 = self.ax.images[1]
|
||||
overlay = im1.cmap(im1.get_array())
|
||||
overlay = im1.cmap(img_as_float(im1.get_array()))
|
||||
overlay = img_as_float(overlay)
|
||||
im0 = self.ax.images[0]
|
||||
underlay = im0.cmap(im0.get_array())
|
||||
underlay = im0.cmap(img_as_float(im0.get_array()))
|
||||
underlay = img_as_float(underlay)
|
||||
alpha = overlay[:, :, 3]
|
||||
alpha = np.dstack((alpha, alpha, alpha))
|
||||
alpha /= alpha.max()
|
||||
composite = (overlay[:, :, :3] * alpha +
|
||||
underlay[:, :, :3] * (1 - alpha))
|
||||
underlay[:, :, :3] * (1 - alpha))
|
||||
io.imsave(filename, composite)
|
||||
|
||||
def closeEvent(self, event):
|
||||
|
||||
Reference in New Issue
Block a user