Skip to main content

Implementation of images in Zarr files.

Project description

Experimental support for multi-resolution images stored in Zarr filesets, according to the OME zarr spec.

Features

  • Use as a image reader plugin for napari. See napari-ome-zarr.

  • Simple command-line to read and download conforming Zarr filesets.

  • Helper methods for parsing related metadata.

Installation

Install the latest release of ome-zarr from PyPI:

pip install ome-zarr

Install developer mode to run from your current branch:

git clone git@github.com:ome/ome-zarr-py.git
cd ome-zarr-py
pip install -e .

Usage

Open Zarr filesets containing images with associated OME metadata. The examples below use the image at http://idr.openmicroscopy.org/webclient/?show=image-6001240.

All examples can be made more or less verbose by passing -v or -q one or more times:

# ome_zarr -vvv ...

info

Use the ome_zarr command to interrogate Zarr datasets:

# Remote data
$ ome_zarr info https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/6001240.zarr/

# Local data (after downloading as below)
$ ome_zarr info 6001240.zarr/

download

To download all the resolutions and metadata for an image:

# creates local 6001240.zarr/
$ ome_zarr download https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/6001240.zarr/

# Specify output directory
$ ome_zarr download https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/6001240.zarr/ --output image_dir

csv to labels

The csv_to_labels command uses a CSV file to add key:value properties to labels under an OME-Zarr Image or Plate.

The OME-Zarr labels metadata must already contain a properties list of {key:value} objects, each with a unique key:ID. This key is omero:shapeId in the example below.

This ID can be used to identify a single row of the CSV table by specifying the name of a column with unique values, e.g. shape_id below. This row is used to add additional column_name:value data to the label properties.

You also need to specify which columns from the CSV to use, e.g. “area,X,Y,Width,Height”. You can also specify the column types (as in https://github.com/ome/omero-metadata/) to specify the data-type for each column (string by default).

  • d: DoubleColumn, for floating point numbers

  • l: LongColumn, for integer numbers

  • s: StringColumn, for text

  • b: BoolColumn, for true/false

Use e.g. #d as a suffix in the column name to denote a float column, no spaces etc: ` "area#d,label_text#s,Width#l,Height#l" `

For example, to take values from columns named area, label_text, Width and Height within a CSV file named labels_data.csv with an ID column named shape_id and add these values to label properties with an ID key of omero:shapeId in an Image or Plate named 123.zarr:

ome_zarr csv_to_labels labels_data.csv shape_id "area#d,label_text#s,Width#l,Height#l" 123.zarr omero:shapeId```

Release process

This repository uses bump2version to manage version numbers. To tag a release run:

$ bumpversion release

This will remove the .dev0 suffix from the current version, commit, and tag the release.

To switch back to a development version run:

$ bumpversion --no-tag [major|minor|patch]

specifying major, minor or patch depending on whether the development branch will be a major, minor or patch release. This will also add the .dev0 suffix.

Remember to git push all commits and tags.

License

Distributed under the terms of the BSD license, “ome-zarr-py” is free and open source software

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ome-zarr-0.2.1.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ome_zarr-0.2.1-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

Details for the file ome-zarr-0.2.1.tar.gz.

File metadata

  • Download URL: ome-zarr-0.2.1.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for ome-zarr-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7e1c0304982252bcb5fd0e3b68ff67e0aca09b3928f78fe090f2a48e46576ba4
MD5 5c889ac68c84ee6fe67e007e1805ae5b
BLAKE2b-256 f7424ffe0621b29877c70f176ab420025e5a9504921006452497cbca306ddd5e

See more details on using hashes here.

File details

Details for the file ome_zarr-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: ome_zarr-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 27.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for ome_zarr-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 01e37ff08f23456372699a08ef223e4ac3acfe44da273ab45eb587d8b0c27f6e
MD5 01bea67752dac6f6987f550730722bc7
BLAKE2b-256 a93501cd8e6e790738298587d3c3ce543771f9a777e10c3cae3438fa9f79d44d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page