Note
Click here to download the full example code
Add multiscale imageΒΆ
Displays a multiscale image
Out:
/Users/mwebermendonca/napari/examples/add_multiscale_image.py:17: FutureWarning: `multichannel` is a deprecated argument name for `pyramid_gaussian`. It will be removed in version 1.0. Please use `channel_axis` instead.
pyramid_gaussian(base, downscale=2, max_layer=4, multichannel=True)
multiscale level shapes: [(4096, 4096), (2048, 2048), (1024, 1024), (512, 512), (256, 256)]
from skimage import data
from skimage.transform import pyramid_gaussian
import napari
import numpy as np
# create multiscale from astronaut image
base = np.tile(data.astronaut(), (8, 8, 1))
multiscale = list(
pyramid_gaussian(base, downscale=2, max_layer=4, multichannel=True)
)
print('multiscale level shapes: ', [p.shape[:2] for p in multiscale])
# add image multiscale
viewer = napari.view_image(multiscale, multiscale=True)
if __name__ == '__main__':
napari.run()