API#
cytomine_utils._utils#
Utility functions used throughout the project.
- cytomine_utils._utils.backup_annotations(project_name, backup_json)#
Retrieve annotations from project and save them to file. Right now it does not write in GeoJSON format.
- cytomine_utils._utils.delete_annotations(image_name)#
Delete all annotations of an image from Cytomine server.
- Parameters:
image_name (
str) – Name of image to delete annotations from.
- cytomine_utils._utils.delete_image(image_name)#
Delete image from Cytomine server.
- cytomine_utils._utils.get_all_images()#
Retrieve all images across all projects.
- Return type:
list[ImageInstance]
- cytomine_utils._utils.get_annotations(project_name)#
Retrieve annotations from all images in a project.
- cytomine_utils._utils.get_annotations_from_image(image_name)#
Retrieve annotations from image.
- cytomine_utils._utils.get_client(verbosity='ERROR')#
Get a Cytomine client.
- Return type:
Cytomine- Parameters:
verbosity (str)
- cytomine_utils._utils.get_credentials(keys_file=None)#
Retrieve credentials from a key file.
- cytomine_utils._utils.get_current_user()#
Retrieve current user model.
- Return type:
User
- cytomine_utils._utils.get_image_by_id(id)#
Retrieve image based on its ID.
- Parameters:
id (
int) – ID of the image to retrieve.- Return type:
ImageInstance
- cytomine_utils._utils.get_image_by_name(image_name)#
Retrieve image based on its name.
- Parameters:
image_name (
str) – Name of the image to retrieve.- Return type:
ImageInstance
- cytomine_utils._utils.get_images_of_project(project_name, **attributes)#
Retrieve all images associated with a project.
- cytomine_utils._utils.get_ontologies()#
Retrieve ontologies across all projects.
- Return type:
list[Ontology]
- cytomine_utils._utils.get_project(name)#
Retrieve a project from a Cytomine instance based on its name.
- Parameters:
name (
str) – Name of project to retrieve.- Return type:
Project
- cytomine_utils._utils.get_projects()#
Retrieve all projects in Cytomine instance.
- Return type:
list[Project]
- cytomine_utils._utils.get_storage()#
Retrieve the user storage from a Cytomine instance.
- Return type:
Storage
- cytomine_utils._utils.get_term_by_id(id)#
Retrieve term based on its ID.
- Parameters:
id (
int) – ID of the term to retrieve.- Return type:
Term
- cytomine_utils._utils.get_term_by_name(term_name)#
Retrieve ontology term based on its name.
- Parameters:
term_name (
str) – Name of the term to retrieve.- Return type:
Term
- cytomine_utils._utils.get_term_id_mapping()#
Retrieve mapping of ontology terms and their IDs. Works across all ontologies.
- cytomine_utils._utils.get_user_by_id(id)#
Retrieve user based on id.
- Parameters:
id (
int) – ID of user.- Return type:
User
- cytomine_utils._utils.upload_annotations(geojson, project_name, image_file, dimensions)#
Upload annotations of an image to Cytomine.
- Parameters:
- Return type:
- cytomine_utils._utils.upload_image(image_file, project_name, **attributes)#
Upload image to Cytomine instance..