Skip to content

High level scripting API to run UI commands ? #121

@Rdornier

Description

@Rdornier

Hi @Rylern

I'm working on a script to delete ROIs from specific owners on OMERO (the script is not doing only that ; doing analysis and send ROIs as well).

Currently, I've found that I can use:

omeroImageServer.getClient().getApisHandler().deleteShapes(
                omeroImageServer.getId(),
                ownerIdsToDelete
        ).get()

However, this requires a list of owner IDs rather than usernames. Since users typically work with usernames (which are more accessible than IDs ; IDs are only accessible by admins and users cannot find them), I was wondering if there's a way to retrieve user information from usernames using the current API. The ICE API allows that with gateway.getFacility(AdminFacility.class).lookupExperimenter(ctx, username).getId().

Additionally, I would like to know how I can run menu commands via scripting. For example, if I want to send annotations & measurements to OMERO while deleting existing ones owned by the current user, I'd like to keep the same logic implemented in the menu commands but I couldn't find any accessible methods reflecting that. I noticed there are individual methods like deleteShapes(), deleteAttachments(), and addShapes(), which are the ones used in the sample scripts, but I'm wondering if there are higher-level methods similar to these examples. which are way more convenient to run and which keep all the logic/checks that are made in the code, to not re-implement them each time in a new script.

Let me know if I'm missing something in the current API.

Best,

Rémy.

ping @romainGuiet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions