silx
silx copied to clipboard
CompareImages: Error when using colormap fixed scale on ROI
The composite item does not store the data the way it is expected by the ColormapDialog.
As result it fails when we use the fixed scale tool from the ColormapDialog
We could fix that by
- Creating a dedicated API for that use case in
Item - Disabling the tool for the
CompareImages - Skipping unknown items from the
ColormapDialog
Traceback (most recent call last):
File "/nobackup/lvalls1/valls/workspace/silx.git/build/lib.linux-x86_64-3.7/silx/gui/dialog/ColormapDialog.py", line 1836, in __roiFinalized
self.setColormapRangeFromDataBounds((ox, ox+width, oy, oy+height))
File "/nobackup/lvalls1/valls/workspace/silx.git/build/lib.linux-x86_64-3.7/silx/gui/dialog/ColormapDialog.py", line 1458, in setColormapRangeFromDataBounds
subset = data[ystart:ystop, xstart:xstop]
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed
I prefer the 1st approach because it makes it clean for a scatter or an image, or anything else.
I prefer the 1st approach because it makes it clean for a scatter or an image
+1
It sounds possible to extend ColormapMixIn.getColormappedRange and pass it the bounds: def getColormappedData(self, copy=True, bounds=None)
Thus code specific to Image and Scatter item in ColormapDialog.setColormapRangeFromDataBounds would move to each item.
Let's keep it open to keep it mind a proper way to solve this