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.

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.5.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

ezomero-0.0.5-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ezomero-0.0.5.tar.gz
  • Upload date:
  • Size: 12.7 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.5.tar.gz
Algorithm Hash digest
SHA256 99c2d1cb290f71c21b5be8a4e300fac1f33d7f11c519f78a43d7df8c5bfd6315
MD5 f7424ad8694241e3b21515997ed5cad9
BLAKE2b-256 da211004a96216c0373a8d7b27c94cd7d1ab88bf1205aaa9506d5e912e22c3e0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ezomero-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 15.0 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 54a1039faaad04d8e6549f0496b4408544eb451226613eb28d3af27455c3115b
MD5 5eadda0a817c9bda6b46bb34d39bf1af
BLAKE2b-256 9d9f82c9e36296098ebe7d9ffc82e06504928d2bdc3fc685369d08e5772c196d

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