Skip to main content

napari-ome-zarr-navigator

License BSD-3 PyPI Python Version tests codecov

A plugin to interact with OME-Zarr images and plates. Enables integrating OME-Zarrs & Fractal tables, browsing plates by conditions, loading ROIs from ROI tables, loading features from feature tables, annotating new ROI tables and saving labels back into OME-Zarr.

Watch the demo

(click the picture above to see the walkthrough video)

Usage

Plate Browser

The Plate Browser loads an OME-Zarr plate from the local filesystem, via authenticated HTTPS (e.g. a Fractal Server instance) or from S3 (s3:// URIs, using the credentials of your AWS environment; when no credentials are found, public buckets are opened anonymously). It also auto-detects plates opened via napari-ome-zarr. The Plate Browser lets you zoom to a selected well ("Go to well"), which draws a bounding box and centers the camera on that well.

plate_browser_go_to_well

Using ngio condition tables, the Plate Browser can filter the well list to any subset defined by one or more conditions. Plate-level condition tables (fast) and image-level condition tables (slower, aggregated on the fly) are both supported.

plate_browser_filtering

ROI Loader

The ROI Loader can be launched directly from napari's Plugins menu (standalone) or by selecting a well in the Plate Browser ("Select ROI to load"). It supports:

  • Loading images from different multiplexing cycles / acquisitions
  • Loading any ROI from ROI tables, or the whole image when no ROI table is selected
  • Loading label images
  • Loading feature measurements from feature tables
  • Multi-resolution (lazy) mode — streams a full dask pyramid, optimal for large images and remote data
  • Fixed resolution mode — loads a single numpy array, optimal for 3D images and downstream tools in napari that don't handle multi-resolution layers (e.g. the label layer needs to be loaded as fixed resolution for using it in the classifier)

Once a ROI has been loaded for one well, "Load selected ROI for additional well(s)" reuses the same settings for any further wells selected in the Plate Browser.

ROI position options

Two options under Advanced settings change where a ROI is placed. Each one is only available when the selected ROI table has the columns it needs, and they can be combined.

  • Load ROI at original position uses the ROI table's x/y/z_micrometer_original columns, e.g. in the FOV_ROI_table written by Fractal's converters. Positions are taken relative to the smallest original position in the table, so fields of view stay in their well and keep the overlaps they had during acquisition. This is useful for stitching, e.g. with multiview-stitcher. Fields of view that didn't overlap land at their regular position.
  • Add registration translation shifts the ROI by the table's translation_x/y/z columns, as written by Fractal's registration tasks, to overlay a multiplexing acquisition on the reference acquisition. Use it only when the registration was calculated but not yet applied to the images; otherwise the shift is applied twice.

Layers loaded with either option don't line up with the image on disk, so the Label Saver won't save them and the ROI Annotator won't allow for saving ROI tables for them. Reload the ROI without these options to do so.

Masked loading

When the selected ROI table is a masking ROI table (one ROI per object of a label image, e.g. organoids or nuclei), Mask ROI by its label under Advanced settings keeps only the selected object: image and label pixels outside the object become 0, and loaded features only cover that object. This shows a single object without the neighbours that share its bounding box, e.g. to make a clean projection of one organoid from its 3D segmentation. Masked label layers only contain the selected object, so the Label Saver won't save them.

roi_loader

This plugin is tested with OME-Zarr files generated by Fractal and is designed to work with any OME-Zarr ≥ v0.4. The feature loading workflow is optimised for use with the napari-feature-classifier.

ROI Annotator

The ROI Annotator can be launched from napari's Plugins menu (standalone, for single images), from the ROI Loader, or from the Plate Browser ("Annotate ROIs", for individual wells). It writes ROI tables and Masking ROI tables back to the OME-Zarr store using ngio.

Interactive ROI annotation

Draw rectangular ROIs by hand on any loaded image. Select Initialize empty ROI layer, click Initialize ROI Layer to create a shapes layer in drawing mode, then draw rectangles. The table name, backend (CSV, JSON, Parquet, AnnData), and overwrite flag can all be configured before saving. Only rectangle annotations are supported.

interactive_roi_table_creation

Limitations (napari shapes layer)

  • Interactively drawn ROIs are always 2D — napari shapes cannot represent 3D extents.
  • Each ROI covers a single time point — shapes do not span multiple frames.

ROI creation from labels (Masking ROI table)

Select Masking ROI layer, choose a label layer that has been loaded into the viewer for a given OME-Zarr image (e.g. loaded by the ROI loader above), and click Calculate masking ROI table. The annotator computes one bounding-box ROI per labelled object using ngio's compute_masking_roi and adds the results as a shapes layer for review. Z-extents are inferred from the label data and stored as shape properties; 3D bounding boxes are supported when the image is 3D. Clicking Save ROI Table writes the result as a Masking ROI table to the OME-Zarr, if a corresponding label is available.

masking_roi_table_creation

Remote OME-Zarr stores

The annotator opens images from local files, authenticated HTTPS stores or S3. Saving back to a remote store is not supported (the store is read-only from the plugin's perspective). When a remote image is loaded, a Save to folder picker appears so the table can be written to a local directory instead.

Save Labels

The Save Labels widget can be launched from napari's Plugins menu (standalone, for single images) or from the ROI Loader ("Save label layer to OME-Zarr"). It saves any napari label layer back to an OME-Zarr image as a label image using ngio, with optional Masking ROI table generation.

Three write modes cover the main use cases:

  • Save as new label — creates the label for the first time; fails if the label already exists
  • Edit existing label — patches only the pixels in the currently loaded ROI; every pixel outside that region stays unchanged (intended for proof-reading individual ROIs)
  • Reset existing label — overwrites the full label with the current layer

Creating new labels

Load an image with the ROI Loader, segment or annotate it in napari, then open the Save Labels widget. Select the label layer, choose a name, and click Save label to OME-Zarr. The pixel size metadata is taken from the napari label layer. Optionally enable Save masking ROI table to derive per-object bounding-box ROIs at the same time.

save_new_label

Proof-reading labels ROI by ROI

Load a single ROI using the ROI Loader, edit the label layer in napari, then switch the write mode to Edit existing label and save. Only the pixels within the loaded ROI are written back; the rest of the label is untouched. Importantly, neither the ROI loader nor the label saving perform masking. Thus, if you load masking ROI tables, be aware that labels outside the mask will still load and you should not remove them, otherwise they get removed from the final label image.

edit_label

Remote OME-Zarr stores

When the source image is on an authenticated remote store (e.g. served by the Fractal data service) or on S3, the label cannot be written back to the read-only remote container. In this case a Local output folder picker appears and the label is saved there instead.

S3 access

Select the S3 source and enter an s3:// URI. Credentials come from the standard AWS chain (environment variables, ~/.aws/credentials / ~/.aws/config, instance role); the plugin has no credential fields. When no credentials are found, public buckets are opened anonymously.

Known limitations:

  • S3 stores are read-only: ROI tables and labels are saved to a local folder.
  • Credentials are read when S3 is first accessed. If you configure or refresh credentials while napari is running, restart napari to use them.
  • Expired or invalid credentials are still used, so they also block public buckets (no anonymous retry). The same problem could occur if using corporate credentials. Refresh them and restart napari, or start napari without them, e.g. AWS_SHARED_CREDENTIALS_FILE=/dev/null napari.

Test data

Test & sample data is available at https://zenodo.org/records/20429951

Installation

pixi manages all Python and system dependencies in a single step:

git clone https://github.com/fractal-napari-plugins-collection/napari-ome-zarr-navigator
cd napari-ome-zarr-navigator
pixi run napari

To launch with the full feature-analysis environment (adds napari-feature-classifier and napari-feature-visualization):

pixi run --frozen napari-fractal

Via pip

Install into an existing Python ≥ 3.11 environment with napari already present:

pip install napari-ome-zarr-navigator

For a fresh environment we recommend miniforge:

conda create -n napari-ome-zarr python=3.12 napari pyqt -c conda-forge
conda activate napari-ome-zarr
pip install napari-ome-zarr-navigator
napari

Optionally also install additional plugins like napari-feature-classifier and napari-feature-visualization, as in:

pip install napari-feature-classifier napari-feature-visualization

Contributing

Contributions are very welcome. Tests can be run with pixi run test; please ensure coverage stays the same before submitting a pull request.

Set up the pre-commit hooks once with pixi run pre-commit install. They run ruff from the pixi environment, so they use the same version as pixi run lint and pixi run format. pixi run check runs lint, type checking and tests together.

License

Distributed under the terms of the BSD-3 license, "napari-ome-zarr-navigator" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

Metadata

Release files for napari-ome-zarr-navigator 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for napari-ome-zarr-navigator 0.5.0
File Size Uploaded Provenance Actions
napari_ome_zarr_navigator-0.5.0.tar.gz 756.8 kB Without provenance Details for napari_ome_zarr_navigator-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for napari-ome-zarr-navigator 0.5.0
File Interpreter ABI Platform Actions
napari_ome_zarr_navigator-0.5.0-py3-none-any.whl Python 3 none any Details for napari_ome_zarr_navigator-0.5.0-py3-none-any.whl

Total release size: 858.5 kB

Release files / napari_ome_zarr_navigator-0.5.0.tar.gz

Download URL napari_ome_zarr_navigator-0.5.0.tar.gz
Size 756.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f328c4cc5600217c0c34c3328721665cbb5841e829c91f206a755c794a36b2d4
BLAKE2b-256 checksum
How to use checksums
d08da33d8bb92e2efa02f3d832e01e34bbf50600bf53ec6a9d80ff67974759d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / napari_ome_zarr_navigator-0.5.0-py3-none-any.whl

Download URL napari_ome_zarr_navigator-0.5.0-py3-none-any.whl
Size 101.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
758822b025cd3bb92ba5eb7add6c137bd429ea2158c91bae7df2811fdf9dfa7a
BLAKE2b-256 checksum
How to use checksums
e465c1692bdd40dd05240c63c4c66eda2ce48c6e7b82691a2c515dcd341eb928
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for napari-ome-zarr-navigator 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page