Merged
Conversation
Grayscale8 and RGB888 images are those that are ready for display without further processing.
you can index (y, x) into a lookup table of shape (nentry, 3) or (nentry, 4) and get an output of shape (y, x, 3) or (y, x, 4)
This reverts commit 45cf310.
this allows uint16 images with user lut to be rendered as Format_Indexed8
this efflut will then be used for Indexed8 format color table. previously, we would be taking a performance hit with doing a numpy lookup with levels_lut.
i.e. no more using lut to do rescale of uint16 image data.
use "xp" instead of numpy module
every one of the four branches now does its own return. this makes it easier to follow.
Contributor
Author
|
Huh. I'm just now noticing that I've been completely neglecting |
Contributor
Well, RawImageWidget and RawImageGLWidget are not made any slower by this PR... |
Contributor
Author
|
Agreed! I was playing with refactors, but for now, this behaves well and looks good. Let's merge it! |
Contributor
|
Found an issue when using ImageView. To trigger it, run the below script and change the colormap by right-clicking on the HistogramLUTItem. It seems to have to do with HistogramLUTItem returning a Callable for self.lut. import pyqtgraph as pg
import cupy as xp
pg.setConfigOption('useCupy', True)
shape = (1024, 1024)
data_uint8 = xp.random.randint(256, size=shape, dtype=xp.uint8)
data_uint16 = xp.random.randint(4096, size=shape, dtype=xp.uint16)
data_float32 = xp.random.normal(size=shape)
pg.mkQApp()
imv = pg.ImageView()
imv.show()
imv.setImage(data_float32)
pg.exec() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This continues #1693 but with corrected cupy behavior.
@pijyoi yeah, the lookup table substrate was the problem.
With that, this branch now provides across-the-board improvements to cupy-enabled benchmarks!