summaryrefslogtreecommitdiff
path: root/silx/gui/plot/tools/profile/rois.py
diff options
context:
space:
mode:
authorPicca Frédéric-Emmanuel <picca@debian.org>2021-01-06 14:10:12 +0100
committerPicca Frédéric-Emmanuel <picca@debian.org>2021-01-06 14:10:12 +0100
commitb3bea947efa55d2c0f198b6c6795b3177be27f45 (patch)
tree4116758aafe4483bf472c1d54b519e685737fd77 /silx/gui/plot/tools/profile/rois.py
parent5ad425ff4e62f5e003178813ebd073577679a00e (diff)
New upstream version 0.14.0+dfsg
Diffstat (limited to 'silx/gui/plot/tools/profile/rois.py')
-rw-r--r--silx/gui/plot/tools/profile/rois.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/silx/gui/plot/tools/profile/rois.py b/silx/gui/plot/tools/profile/rois.py
index b49679c..9e651a7 100644
--- a/silx/gui/plot/tools/profile/rois.py
+++ b/silx/gui/plot/tools/profile/rois.py
@@ -137,11 +137,11 @@ class _ImageProfileArea(items.Shape):
if not isinstance(item, items.ImageBase):
raise TypeError("Unexpected class %s" % type(item))
- if isinstance(item, items.ImageData):
- currentData = item.getData(copy=False)
- elif isinstance(item, items.ImageRgba):
+ if isinstance(item, items.ImageRgba):
rgba = item.getData(copy=False)
currentData = rgba[..., 0]
+ else:
+ currentData = item.getData(copy=False)
roi = self.getParentRoi()
origin = item.getOrigin()
@@ -310,15 +310,15 @@ class _DefaultImageProfileRoiMixIn(core.ProfileRoiMixIn):
method=method)
return coords, profile, profileName, xLabel
- if isinstance(item, items.ImageData):
- currentData = item.getData(copy=False)
- elif isinstance(item, items.ImageRgba):
+ if isinstance(item, items.ImageRgba):
rgba = item.getData(copy=False)
is_uint8 = rgba.dtype.type == numpy.uint8
# luminosity
if is_uint8:
- rgba = rgba.astype(numpy.float)
+ rgba = rgba.astype(numpy.float64)
currentData = 0.21 * rgba[..., 0] + 0.72 * rgba[..., 1] + 0.07 * rgba[..., 2]
+ else:
+ currentData = item.getData(copy=False)
yLabel = "%s" % str(method).capitalize()
coords, profile, title, xLabel = createProfile2(currentData)