Skip to main content

A suite of convenience functions for working with OMERO. Written and maintained by the Research IT team at The Jackson Laboratory.

Project description

ezomero

A module with convenience functions for writing Python code that interacts with OMERO.

Installation

Just pip install ezomero and you should be good to go! The repo contains a requirements.txt file with the specific package versions we test ezomero with, but any Python>=3.6 and latest omero-py and numpy should work - note that this package is in active development!

Usage

In general, you will need to create a BlitzGateway object using omero-py, successfully do something like conn.connect() and then pass the conn object to most of these helper functions along with function-specific parameters.

Functions

post functions

post_dataset(conn, dataset_name, project_id, description)

Creates a new dataset. Returns a (new) dataset ID.

post_image(conn, image, image_name, description=None, dataset_id=None, source_image_id=None, channel_list=None)

Creates a new OMERO image from a numpy array. Returns a (new) image ID.

post_map_annotation(conn, object_type, object_ids, kv_dict, ns)

Creates a new MapAnnotation and links to images. Returns a (new) MapAnnotation ID.

post_project(conn, project_name, description=None)

Creates a new project. Returns a (new) project ID.

get functions

get_image(conn, image_id, no_pixels=False, start_coords=None, axis_lengths=None, xyzct=False, pad=False)

Gets omero image object along with pixels as a numpy array. Returns an omero.gateway.ImageWrapper object along with an ndarray containing the image pixels.

get_image_ids(conn, dataset=None, well=None)

Returns a list of image ids based on project and dataset. Returns a list of ints with the desired IDs.

get_map_annotation_ids(conn, object_type, object_id, ns=None)

Get IDs of map annotations associated with an object. Returns a list of ints with the desired IDs.

get_map_annotation(conn, map_ann_id)

Get the value of a map annotation object. Returns a dict with the contents of the desired MapAnnotation.

get_group_id(conn, group_name)

Get ID of a group based on group name. Must be an exact match. Case sensitive. Returns a single int.

get_user_id(conn, user_name)

Get ID of a user based on username. Must be an exact match. Case sensitive. Returns a single int.

get_original_filepaths(conn, image_id, fpath='repo')

Get paths to original files for specified image. Returns a list of str.

put functions

put_map_annotation(conn, map_ann_id, kv_dict, ns=None)

Update an existing map annotation with new values (kv pairs).

Filter functions

filter_by_filename(conn, im_ids, imported_filename)

Filter list of image ids by originalFile name. Returns a list of int image IDs that match.

image_has_imported_filename(conn, im_id, imported_filename)

DEPRECATED. Ask whether an image is associated with a particular image file. Returns a boolean.

Linking functions

link_images_to_dataset(conn, image_ids, dataset_id)

Adds the images with given IDs to the dataset with given ID.

link_datasets_to_project(conn, dataset_ids, project_id)

Adds the datasets with given IDs to the project with given ID.

print functions

print_map_annotation(conn, map_ann_id)

Print some information and value of a map annotation.

print_groups(conn)

Print all Groups with IDs and membership info.

print_projects(conn)

Print all available Projects.

print_datasets(conn, project=None)

Print all available Datasets for a given Project.

Other functions

set_group(conn, group_id)

Safely switch OMERO group. This function will change the user's current group to that specified by group_id, but only if the user is a member of that group. Returns a boolean with success status.

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

ezomero-0.0.4.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

ezomero-0.0.4-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file ezomero-0.0.4.tar.gz.

File metadata

  • Download URL: ezomero-0.0.4.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.12

File hashes

Hashes for ezomero-0.0.4.tar.gz
Algorithm Hash digest
SHA256 184ab896b4840b3ed238226248381ed2a305bd153c89730bdefe637c990bec25
MD5 3dee7ee962b49efc41afb976f18c5993
BLAKE2b-256 57ba1f0c0ad8d566cc9526f32afa299f33f2dbaec9049979dfbfa3e773a318cc

See more details on using hashes here.

File details

Details for the file ezomero-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: ezomero-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.12

File hashes

Hashes for ezomero-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2c1889f3f8f9c1cdb26d7f9e843cd0d5bc98ccf481233dd346ae042cea4be004
MD5 55a3ced42cdc2c60835a11f05afafa87
BLAKE2b-256 b6abba2a3886f9beb3a8d1217a0212c4a5d0d8e85c9488a03b848889de025d4e

See more details on using hashes here.

Supported by

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