Examples#

This section provides executable examples demonstrating various features of xarray-ome. All examples use real OME-NGFF sample data from the Image Data Resource (IDR).

Note

These examples are executed automatically during documentation builds, ensuring they always work with the latest version of xarray-ome.

Example Notebooks#

Basic Usage

Learn the fundamentals of opening and working with OME-Zarr files.

  • Opening as Dataset and DataTree

  • Exploring coordinates and metadata

  • Lazy loading with Dask

  • Selecting subsets

Basic Usage
Channel Labels

Work with channel labels from OME metadata.

  • Accessing channel names

  • Selecting by channel label

  • Physical coordinates and units

  • Metadata inspection

Working with Channel Labels

Running Examples Locally#

All examples can be run from the command line or in a Jupyter notebook:

As Python Scripts#

The examples are also available as standalone Python scripts in the examples/ directory:

# Using uv (recommended)
uv run python examples/idr_channel_labels.py

# Or with standard Python
python examples/idr_channel_labels.py

In Jupyter#

Convert any example to a Jupyter notebook:

# Install jupytext if needed
uv add --dev jupytext

# Convert MyST markdown to notebook
jupytext --to ipynb docs/examples/basic_usage.md

# Open in Jupyter
jupyter notebook basic_usage.ipynb

Additional Resources#