Skip to content

Commit

Permalink
Merge pull request #9 from AstraZeneca/update-readme
Browse files Browse the repository at this point in the history
Update installation instructions
  • Loading branch information
pmplewa authored Feb 7, 2025
2 parents 5588b60 + 9ba4f0b commit 00a3b2b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
40 changes: 37 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,57 @@ A plugin to read whole-slide images within [napari].

---

## Installation
## Installation via pip

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

```bash
pip install napari-wsi[all]
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]
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

To set up a new [conda] environment for `napari-wsi` that also includes all
optional dependencies, create a new file named `napari-wsi.yml` with the
following content:

```yaml
name: napari-wsi
channels:
- conda-forge
dependencies:
- python=3.11
- napari-wsi=1.*
# napari
- napari
- pyqt
# openslide backend
- openslide>=4.0
- openslide-python>=1.4
# rasterio backend
- rasterio>=1.4
- pip:
# wsidicom backend
- wsidicom>=0.22
- numpy<=2.1 # for numba
```
Then create this environment by running:
```bash
conda env create -f napari-wsi.yml
```

# Description

This [napari] plugin provides a widget for reading various whole-slide image
Expand Down Expand Up @@ -62,6 +95,7 @@ viewer = Viewer()
viewer.open("CMU-1.svs", plugin="napari-wsi")
```

[conda]: https://conda-forge.org/
[napari]: https://github.com/napari/napari
[openslide]: https://github.com/openslide/openslide-python
[openslide-bin]: https://pypi.org/project/openslide-bin/
Expand Down
3 changes: 1 addition & 2 deletions napari_wsi/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
from zarr.storage import MemoryStore

from .backends.common import WSIReaderBackend
from .color_transform import ColorSpace, ColorTransform

if TYPE_CHECKING:
import napari

from .color_transform import ColorSpace, ColorTransform


@dataclass(frozen=True)
class PyramidLevel(Metadata):
Expand Down

0 comments on commit 00a3b2b

Please # to comment.