-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify colormaps #31
Simplify colormaps #31
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on fast code check, the napari dependency could be removed, as if colormap is passed by name, then napari will convert string to colormap instance.
Same with passing colormap as array. It will be properly handled by napari and converted into colormap instance.
I don't think this is actually true. The original version of this code use vispy colormaps, but I suspect that was part of the cause for bug #28. I'm hoping napari is better able to recognise its own colormaps and avoid duplicates. |
EDIT: ah, there is a second place besides the
|
So maybe add alpha colormap to napari? It is short to 0.5.0 release. Or just add colormap as
As far as I know, it is not better. The best way to avoid duplicates is to provide a named colormap. Then napari will check duplicates by name. |
but there could be only array passed to napari. And napari will convert it to colormap. |
This won't get rid of the problem of duplicate colormaps being generated, will it? To be clear, it also sounds like passing an explicit napari Colormap object also still gives us this duplicate colormap problem, unlike what I'd assumed earlier. |
Might have to ask if there's any interest in this.
Passing That's not too surprising though, looking at the docs
|
Ah, but it does work if you pass it in as a numpy array. |
For me, reading code like I still do not have an idea how to deduplicate colormap created from |
Co-authored-by: Grzegorz Bokota <[email protected]>
I don't think we can hold this open any longer for additional reviewers, so I'm going to merge these changes now. |
Closes #28
Replace most colormap code with inbuilt napari colormap functions.