forked from napari/napari
-
Notifications
You must be signed in to change notification settings - Fork 0
/
minimum_blending.py
33 lines (28 loc) · 1.31 KB
/
minimum_blending.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""
Minimum blending
================
Demonstrates how to use the `minimum` blending mode with inverted colormaps.
`minimum` blending uses the minimum value of each R, G, B channel for each pixel.
`minimum` blending can be used to yield multichannel color images on a white
background, when the channels have inverted colormaps assigned.
An inverted colormap is one where white [1, 1, 1] is used to represent the lowest
values, as opposed to the more conventional black [0, 0, 0]. For example, try the
colormaps prefixed with *I*, such as *I Forest* or *I Bordeaux*, from
ChrisLUTs: https://github.com/cleterrier/ChrisLUTs .
"""
from skimage import data
import napari
# create a viewer
viewer = napari.Viewer()
# Add the cells3d example image, using the two inverted colormaps
# and minimum blending mode. Note that the bottom-most layer
# must be translucent or opaque to prevent blending with the canvas.
viewer.add_image(data.cells3d(),
name=["membrane", "nuclei"],
channel_axis=1,
contrast_limits = [[1110, 23855], [1600, 50000]],
colormap = ["I Purple", "I Orange"],
blending= ["translucent_no_depth", "minimum"]
)
if __name__ == '__main__':
napari.run()