Coder Social home page Coder Social logo

constantinpape / ome-zarr-py Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ome/ome-zarr-py

1.0 2.0 0.0 291 KB

Experimental implementation of next-generation file format (NGFF) specifications for storing bioimaging data in the cloud.

License: Other

Python 100.00%

ome-zarr-py's Introduction

ome-zarr-py

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

Features

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 [email protected]: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://s3.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://s3.embassy.ebi.ac.uk/idr/zarr/v0.1/6001240.zarr/

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

napari plugin

Napari will use ome-zarr to open images that the plugin recognises as ome-zarr. The image metadata from OMERO will be used to set channel names and rendering settings in napari:

$ napari 'https://s3.embassy.ebi.ac.uk/idr/zarr/v0.1/6001240.zarr/'

# Also works with local files
$ napari 6001240.zarr

OR in python:

import napari
with napari.gui_qt():
    viewer = napari.Viewer()
    viewer.open('https://s3.embassy.ebi.ac.uk/idr/zarr/v0.1/6001240.zarr/')

If single zarray is passed to the plugin, it will be opened without the use of the metadata:

$ napari '/tmp/6001240.zarr/0'

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

ome-zarr-py's People

Contributors

carreau avatar glyg avatar jburel avatar jni avatar joshmoore avatar manics avatar nhpatterson avatar perlman avatar pre-commit-ci[bot] avatar sbesson avatar tlambert03 avatar will-moore avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.