|
12 | 12 | **A generalized image format reader for napari built on top of [bioio]** |
13 | 13 |
|
14 | 14 | `ndevio` provides flexible, metadata-aware image I/O for images in napari. |
15 | | -Originally developed as part of napari-ndev, `ndevio` has since been separated into its own plugin as part of the [ndev-kit] and is intended to be a feature-rich and easier to maintain spiritual successor to [napari-aicsimageio]. |
| 15 | +Originally developed as part of napari-ndev (as a spiritual successor to [napari-aicsimageio]), `ndevio` has since been separated into its own plugin as part of the [ndev-kit] and is intended to be a feature-rich, metadata-aware image reader for a variety of formats in napari, with a focus on microscopy images. |
16 | 16 |
|
17 | 17 | ---------------------------------- |
18 | 18 |
|
19 | 19 | ## Features |
20 | 20 |
|
21 | 21 | - **Extensive format support** via [bioio] and its plugin system — read OME-TIFF, OME-Zarr, common image and movie formats, proprietary formats (CZI, LIF, ND2), and many more (with bioformats)! |
22 | 22 | - **Multi-scene handling** — interactive widget for selecting between scenes/positions in multi-scene files |
| 23 | +- **Thorough metadata extraction** — extract and apply scale, units, axis labels, metadata (inc. OME) to napari layers |
| 24 | +- **Remote file support** — compatible Bioio readers,such as [bioio-ome-zarr], can read from remote filesystems (HTTP, S3, etc.) with dask-backed loading |
| 25 | +- **Native multiscale support** — automatically read and display multiscale images when supported by the reader. For best experience, turn on the asynchronous rendering experimental setting in napari. |
23 | 26 | - **Configurable behavior** via [ndev-settings] — customize reader priority, multi-scene handling, and more |
24 | 27 | - **Smart plugin installation** — automatic suggestions to install missing bioio reader plugins |
25 | 28 | - **Programmatic API** — `nImage` class for napari-ready metadata extraction |
@@ -56,7 +59,9 @@ To contibute to ndevio or experiment with the latest features, see [Contributing |
56 | 59 | If your image format is not supported by the default readers, then you will get a warning and (by default in napari) a widget to install the suggested reader. |
57 | 60 | If you know of your additional proprietary formats, install the appropriate bioio reader. |
58 | 61 | See the [bioio documentation](https://bioio-devs.github.io/bioio/) for the full list of available readers. |
59 | | -**Note**: The use of `bioio-bioformats` has not been fully tested and may have issues. Please [file an issue] if you encounter problems. |
| 62 | +**Note**: The use of `bioio-bioformats` requires an automatic, initial download of required Java files, this takes some time. Most native format readers do a better job reading metadata compared to `bioio-bioformats`. |
| 63 | + |
| 64 | +Please [file an issue] if you encounter problems with image reading! |
60 | 65 |
|
61 | 66 | ## Usage |
62 | 67 |
|
@@ -111,14 +116,15 @@ from napari import Viewer |
111 | 116 | img = nImage("path/to/image.czi") |
112 | 117 |
|
113 | 118 | # Because nImage subclasses BioImage, all BioImage methods are available |
114 | | -img.dims # e.g., <Dimensions [T: 15, C: 4, Z: 1, Y: 256, X: 256]> |
| 119 | +print(img.dims) # e.g., <Dimensions [T: 15, C: 4, Z: 1, Y: 256, X: 256]> |
115 | 120 |
|
116 | 121 | # Access napari-ready properties, note that channel and singleton dimensions are dropped |
117 | | -img.layer_data.shape # e.g. (15, 4, 256, 256) - still includes channel dimbecause it has not yet been converted to a list of LayerDataTuples |
118 | | -img.layer_scale # e.g., (1.0, 0.2, 0.2) - time interval + physical scale per dimension, napari ready |
119 | | -img.layer_axis_labels # e.g., ('T', 'Y', 'X') |
120 | | -img.layer_units # e.g., ('s', 'µm', 'µm') |
121 | | -img.layer_metadata # e.g., a dictionary containing the 1) full BioImage object, 2) raw_image metadata and 3) OME metadata (if parsed) - accessible via `viewer.layers[n].metadata` |
| 122 | +print(img.reference_xarray) # e.g., xarray.DataArray with dims (T, Y, X) and shape (15, 256, 256) |
| 123 | +print(img.layer_data[0]) # e.g. the highest resolution array; a list is returned for multiscale image support |
| 124 | +print(img.layer_scale) # e.g., (1.0, 0.2, 0.2) - time interval + physical scale per dimension, napari ready |
| 125 | +print(img.layer_axis_labels) # e.g., ('T', 'Y', 'X') |
| 126 | +print(img.layer_units) # e.g., ('s', 'µm', 'µm') |
| 127 | +print(img.layer_metadata) # e.g., a dictionary containing the 1) full BioImage object, 2) raw_image metadata and 3) OME metadata (if parsed) - accessible via `viewer.layers[n].metadata` |
122 | 128 |
|
123 | 129 | # A convenience method to get napari LayerDataTuples with nImage metadata for napari |
124 | 130 | viewer = Viewer() |
@@ -155,6 +161,7 @@ Images are loaded **in-memory** or **lazily** (via dask) automatically based on: |
155 | 161 |
|
156 | 162 | - File size < 4 GB **AND** |
157 | 163 | - File size < 30% of available RAM |
| 164 | +- Remote files (e.g., S3, HTTP) and multiscale are always loaded lazily |
158 | 165 |
|
159 | 166 | ### Multi-channel Images |
160 | 167 |
|
@@ -208,3 +215,4 @@ If you encounter any problems, please [file an issue] along with a detailed desc |
208 | 215 | [nbatch]: https://github.com/ndev-kit/nbatch |
209 | 216 | [uv]: https://docs.astral.sh/uv/ |
210 | 217 | [ndev-kit]: https://github.com/ndev-kit |
| 218 | +[bioio-ome-zarr]: https://github.com/bioio-devs/bioio-ome-zarr |
0 commit comments