Skip to main content

A suite of convenience functions for working with OMERO. Written and maintained by theResearch 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.2.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

ezomero-0.0.2-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ezomero-0.0.2.tar.gz
  • Upload date:
  • Size: 10.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.55.1 CPython/3.6.12

File hashes

Hashes for ezomero-0.0.2.tar.gz
Algorithm Hash digest
SHA256 530dd58fe68016ad626dd87dc46352ebd60ef948cd28f6165c6a31c258d5cab2
MD5 f2a0f8e7ea7c341c72d40db7fedf3d6b
BLAKE2b-256 8f8240287a028d5d2b0c09d059fe9c099cc8ffc402c92bdd83a6b7757a4eb14b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ezomero-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.1 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.55.1 CPython/3.6.12

File hashes

Hashes for ezomero-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8b903221f413a283280e30e6c7723824b133e27701a2329ba92bd03570774553
MD5 86c0a7a2870e76b0fd09f0e03c572e19
BLAKE2b-256 d016e24af1470a0eb14b953fc0c38ad1cb3f9fecb28cde2e80c67fd7c0a98a68

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