diff options
Diffstat (limited to 'silx/gui/plot/tools/profile/rois.py')
-rw-r--r-- | silx/gui/plot/tools/profile/rois.py | 14 |
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) |