-
-
Notifications
You must be signed in to change notification settings - Fork 411
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
HiLO LUT #6878
Comments
This seems pretty easy to do: from napari.utils.colormaps import AVAILABLE_COLORMAPS
hilo = AVAILABLE_COLORMAPS['gray']
hilo.colors[0] = [0, 0, 1, 1] # blue (lowest pixel values)
hilo.colors[-1] = [1, 0, 0, 1] # red (highest pixel values) And checking that it works: # check with uint8 data
import napari
import skimage.data
viewer = napari.Viewer()
camera = skimage.data.camera()
viewer.add_image(camera, colormap=hilo) # check with float data
import napari
import numpy as np
viewer = napari.Viewer()
data = np.random.random((20, 20))
viewer.add_image(data, colormap=hilo) |
Thought so too but @Czaki and I checked this and this does not seem to be correct. We had the same approach, but due to conversion to uint8 in vispy for a 16 bit image for example the intensity values are binned. This means that if you have intensity values of both 0 and 1 in your 16 bit image, both will be blue, which should not be the case. A shader is required |
We also tried with by adjusting the controls of a custom color map, but same issue. |
If you run this you will see that when switching to HiLo LUT that values 1 are blue and 65534 are red which should not happen. The image itself is 16bit |
馃殌 Feature
Implement the HiLo LUT that is also present in FIJI for the purpose of intensity clipping as shown below:
Motivation
(https://forum.image.sc/t/add-hilo-colormap-to-napari/95601/4)
The text was updated successfully, but these errors were encountered: