napari-wsi
A plugin to read whole-slide images within napari.
Installation via pip
You can install napari-wsi via pip:
pip install "napari-wsi[all]>=1.0"
This automatically installs all optional backends, as a shortcut for:
pip install "napari-wsi[openslide,rasterio,wsidicom]>=1.0"
In addition, to be able to read images using the openslide backend, it is
required to install the OpenSlide library itself, for example by installing the
openslide-bin python package (also via pip).
Installation via conda
You can also install napari-wsi via conda:
conda install -c conda-forge "napari-wsi>=1.0"
This already installs all optional dependencies, including OpenSlide.
Description
This napari plugin provides a widget for reading various whole-slide image formats using a common zarr store inteface, based on the libraries openslide, rasterio, and wsidicom.
Quickstart
After installation, open the Plugins menu in the viewer and select
WSI Reader to open the widget. Then select a Backend to use, select a Path
to open, and click Load.
If sRGB is selected in the Color Space menu and an ICC profile is attached
to the given image, a transformation to this color space will be applied when
the image data is read. Otherwise, the raw RGB image data will be displayed.
This plugin can also be used to open image files via drag and drop into the
viewer window. The file suffixes '.bif', '.ndpi', '.scn', '.svs' are registered
with the openslide backend, while the suffixes '.tif' and '.tiff' are
registered with the rasterio backend. These files can also be opened directly
from the command line or from a python script:
napari CMU-1.svs
from napari import Viewer
viewer = Viewer()
viewer.open("CMU-1.svs", plugin="napari-wsi")
It is also possible to use the different backend classes directly, in which case some more features are available, for example:
from napari import Viewer
from napari_wsi.backends.openslide import OpenSlideStore
viewer = Viewer()
# Display the image in the sRGB color space and a physical coordinate system:
store = OpenSlideStore("CMU-1.svs", color_space="sRGB")
(layer,) = store.to_viewer(viewer, spatial_transform=True)
assert layer.metadata["color_space"] == "sRGB"
# Display a scale bar to indicate milli- or micrometers, depending on the zoom level:
viewer.scale_bar.visible = True
viewer.scale_bar.colored = True
from napari import Viewer
from napari_wsi.backends.wsidicom import WSIDicomStore
from requests.auth import HTTPBasicAuth
from wsidicom import WsiDicomWebClient
viewer = Viewer()
client = WsiDicomWebClient.create_client("...", auth=HTTPBasicAuth("...", "..."))
store = WSIDicomStore(client=client, study_uid="...", series_uids="...")
store.to_viewer(viewer)
The sample images used above are part of the OpenSlide test data (see Aperio and DICOM).
Known Issues & Other Notes
- This plugin is prototype research software and there may be breaking changes with each release of the plugin, which is also the case for current releases of the napari viewer itself.
- The
wsidicombackend supports loading annotations together with the image data. However, this may take several minutes, depending on the number and complexity of the annotations. When loading more than a few thousand polygon annotations, make sure that the experimental "triangles speedup" setting is enabled.
Release files for napari-wsi 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| napari_wsi-1.3.0.tar.gz | 4.4 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| napari_wsi-1.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.6 MB
Release files / napari_wsi-1.3.0.tar.gz
| Download URL | napari_wsi-1.3.0.tar.gz |
|---|---|
| Size | 4.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f3a6f97ffa0f0821a23d6a31d9c63b726f303b12abcb96aa493cc011ea02bb4
|
|
BLAKE2b-256 checksum How to use checksums |
9cb11a4526459cf194bdf311d6768a178b0b59adadf9613cc07e376602e5535d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / napari_wsi-1.3.0-py3-none-any.whl
| Download URL | napari_wsi-1.3.0-py3-none-any.whl |
|---|---|
| Size | 138.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
693fb7b602e7b7904c6892e93a4237e37c0371fa92a59e56fd4597db249879b8
|
|
BLAKE2b-256 checksum How to use checksums |
ea5e71107cb41d5087f370c2688c7d9ee905eb2855cfc01c5b5d96ca8da3b9b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|