napari-wsi


Namenapari-wsi JSON
Version 1.2.0 PyPI version JSON
download
home_pageNone
SummaryA plugin to read whole-slide images within napari.
upload_time2025-02-14 11:36:27
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # napari-wsi

[![PyPI](https://img.shields.io/pypi/v/napari-wsi.svg?color=green)](https://pypi.org/project/napari-wsi)
[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-wsi)](https://napari-hub.org/plugins/napari-wsi)
[![Tests](https://github.com/AstraZeneca/napari-wsi/actions/workflows/main.yml/badge.svg)](https://github.com/AstraZeneca/napari-wsi/actions)
![Maturity Level-1](https://img.shields.io/badge/Maturity%20Level-ML--1-yellow)

A plugin to read whole-slide images within [napari].

---

## Installation via pip

You can install `napari-wsi` via [pip]:

```bash
pip install "napari-wsi[all]>=1.0"
```

This automatically installs all optional backends, as a shortcut for:

```bash
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]:

```bash
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`.

![The napari viewer displaying a sample image.](./resources/sample_data.jpg)

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:

```bash
napari CMU-1.svs
```

```python
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:

```python
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
```

```python
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 `wsidicom` backend 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.

[Aperio]: https://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/
[conda]: https://conda-forge.org/
[DICOM]: https://openslide.cs.cmu.edu/download/openslide-testdata/DICOM/
[napari]: https://github.com/napari/napari
[openslide]: https://github.com/openslide/openslide-python
[openslide-bin]: https://pypi.org/project/openslide-bin/
[pip]: https://github.com/pypa/pip
[rasterio]: https://github.com/rasterio/rasterio
[triangles]: https://napari.org/island-dispatch/blog/triangles_speedup_beta.html
[wsidicom]: https://github.com/imi-bigpicture/wsidicom
[zarr]: https://github.com/zarr-developers/zarr-python

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "napari-wsi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": "Philipp Plewa <philipp.plewa@astrazeneca.com>, Robert Schweizer <robert.schweizer@astrazeneca.com>",
    "keywords": null,
    "author": null,
    "author_email": "Philipp Plewa <philipp.plewa@astrazeneca.com>",
    "download_url": "https://files.pythonhosted.org/packages/93/d3/5eb0665a5cd0508fdaaa83f32c0e1938014dcd6f90b3ecc60837e107d347/napari_wsi-1.2.0.tar.gz",
    "platform": null,
    "description": "# napari-wsi\n\n[![PyPI](https://img.shields.io/pypi/v/napari-wsi.svg?color=green)](https://pypi.org/project/napari-wsi)\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-wsi)](https://napari-hub.org/plugins/napari-wsi)\n[![Tests](https://github.com/AstraZeneca/napari-wsi/actions/workflows/main.yml/badge.svg)](https://github.com/AstraZeneca/napari-wsi/actions)\n![Maturity Level-1](https://img.shields.io/badge/Maturity%20Level-ML--1-yellow)\n\nA plugin to read whole-slide images within [napari].\n\n---\n\n## Installation via pip\n\nYou can install `napari-wsi` via [pip]:\n\n```bash\npip install \"napari-wsi[all]>=1.0\"\n```\n\nThis automatically installs all optional backends, as a shortcut for:\n\n```bash\npip install \"napari-wsi[openslide,rasterio,wsidicom]>=1.0\"\n```\n\nIn addition, to be able to read images using the `openslide` backend, it is\nrequired to install the OpenSlide library itself, for example by installing the\n[openslide-bin] python package (also via [pip]).\n\n## Installation via conda\n\nYou can also install `napari-wsi` via [conda]:\n\n```bash\nconda install -c conda-forge \"napari-wsi>=1.0\"\n```\n\nThis already installs all optional dependencies, including OpenSlide.\n\n# Description\n\nThis [napari] plugin provides a widget for reading various whole-slide image\nformats using a common [zarr] store inteface, based on the libraries\n[openslide], [rasterio], and [wsidicom].\n\n# Quickstart\n\nAfter installation, open the `Plugins` menu in the viewer and select\n`WSI Reader` to open the widget. Then select a `Backend` to use, select a `Path`\nto open, and click `Load`.\n\n![The napari viewer displaying a sample image.](./resources/sample_data.jpg)\n\nIf `sRGB` is selected in the `Color Space` menu and an ICC profile is attached\nto the given image, a transformation to this color space will be applied when\nthe image data is read. Otherwise, the raw RGB image data will be displayed.\n\nThis plugin can also be used to open image files via drag and drop into the\nviewer window. The file suffixes '.bif', '.ndpi', '.scn', '.svs' are registered\nwith the `openslide` backend, while the suffixes '.tif' and '.tiff' are\nregistered with the `rasterio` backend. These files can also be opened directly\nfrom the command line or from a python script:\n\n```bash\nnapari CMU-1.svs\n```\n\n```python\nfrom napari import Viewer\n\nviewer = Viewer()\nviewer.open(\"CMU-1.svs\", plugin=\"napari-wsi\")\n```\n\nIt is also possible to use the different backend classes directly, in which case\nsome more features are available, for example:\n\n```python\nfrom napari import Viewer\nfrom napari_wsi.backends.openslide import OpenSlideStore\n\nviewer = Viewer()\n\n# Display the image in the sRGB color space and a physical coordinate system:\nstore = OpenSlideStore(\"CMU-1.svs\", color_space=\"sRGB\")\n(layer,) = store.to_viewer(viewer, spatial_transform=True)\nassert layer.metadata[\"color_space\"] == \"sRGB\"\n\n# Display a scale bar to indicate milli- or micrometers, depending on the zoom level:\nviewer.scale_bar.visible = True\nviewer.scale_bar.colored = True\n```\n\n```python\nfrom napari import Viewer\nfrom napari_wsi.backends.wsidicom import WSIDicomStore\nfrom requests.auth import HTTPBasicAuth\nfrom wsidicom import WsiDicomWebClient\n\nviewer = Viewer()\nclient = WsiDicomWebClient.create_client(\"...\", auth=HTTPBasicAuth(\"...\", \"...\"))\nstore = WSIDicomStore(client=client, study_uid=\"...\", series_uids=\"...\")\nstore.to_viewer(viewer)\n```\n\nThe sample images used above are part of the OpenSlide test data (see [Aperio]\nand [DICOM]).\n\n# Known Issues & Other Notes\n\n- This plugin is prototype research software and there may be **breaking\n  changes** with each release of the plugin, which is also the case for current\n  releases of the [napari] viewer itself.\n- The `wsidicom` backend supports loading annotations together with the image\n  data. However, this may take several minutes, depending on the number and\n  complexity of the annotations. When loading more than a few thousand polygon\n  annotations, make sure that the experimental \"[triangles] speedup\" setting is\n  enabled.\n\n[Aperio]: https://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/\n[conda]: https://conda-forge.org/\n[DICOM]: https://openslide.cs.cmu.edu/download/openslide-testdata/DICOM/\n[napari]: https://github.com/napari/napari\n[openslide]: https://github.com/openslide/openslide-python\n[openslide-bin]: https://pypi.org/project/openslide-bin/\n[pip]: https://github.com/pypa/pip\n[rasterio]: https://github.com/rasterio/rasterio\n[triangles]: https://napari.org/island-dispatch/blog/triangles_speedup_beta.html\n[wsidicom]: https://github.com/imi-bigpicture/wsidicom\n[zarr]: https://github.com/zarr-developers/zarr-python\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A plugin to read whole-slide images within napari.",
    "version": "1.2.0",
    "project_urls": {
        "Repository": "https://github.com/AstraZeneca/napari-wsi"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "935381f4bfd3eaed687bef7fd3ec9ee40dd5711248b36a1e25a30b5409396942",
                "md5": "a1eff6cc3c9c5f63a21e5099ca5eba7a",
                "sha256": "a90a57f6f30b325bbd83efde961f8840bfdadc48b1b30663213c49036c7fe1d4"
            },
            "downloads": -1,
            "filename": "napari_wsi-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a1eff6cc3c9c5f63a21e5099ca5eba7a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 21954,
            "upload_time": "2025-02-14T11:13:37",
            "upload_time_iso_8601": "2025-02-14T11:13:37.323020Z",
            "url": "https://files.pythonhosted.org/packages/93/53/81f4bfd3eaed687bef7fd3ec9ee40dd5711248b36a1e25a30b5409396942/napari_wsi-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "93d35eb0665a5cd0508fdaaa83f32c0e1938014dcd6f90b3ecc60837e107d347",
                "md5": "639275c426f0675d7daf93be3a67d52e",
                "sha256": "19eec2d5d837c90b08f4862f40110d3e82c2d91704692a1984fac1e2619365e4"
            },
            "downloads": -1,
            "filename": "napari_wsi-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "639275c426f0675d7daf93be3a67d52e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 4212586,
            "upload_time": "2025-02-14T11:36:27",
            "upload_time_iso_8601": "2025-02-14T11:36:27.044461Z",
            "url": "https://files.pythonhosted.org/packages/93/d3/5eb0665a5cd0508fdaaa83f32c0e1938014dcd6f90b3ecc60837e107d347/napari_wsi-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-14 11:36:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "AstraZeneca",
    "github_project": "napari-wsi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "napari-wsi"
}
        
Elapsed time: 0.81514s