Personal tools
  • We're Hiring!

You are here: Home Support Training Material Training Documents 9 Scripts

9 Scripts

OMERO allows Python scripts to be uploaded to the server and registered for server-side execution. Clients can launch scripts and retrieve results without ever having to download the data. At the same time, extra functionality can be added to an OMERO server without an upgrade.

This is a guide to getting started with the scripting service, without going into the 'behind the scenes' details. More technical details can be found on the OmeroScripts page.

9.1 Running Scripts

Scripts can be run from both client applications, OMERO.insight as well as OMERO.web, using a UI generated from the script. The script results can also be handled by both clients, allowing users to view OMERO Images or Datasets created by the script, or download files like CSVs or PNGs.

Open the OMERO.insight or OMERO.web application and login to the OMERO server. Use the hierarchy panel to select an existing multi-channel Image. To run a script locate the metadata browser panel and the icon. This will bring up the list of available scripts as shown below in OMERO.insight.

or in the OMERO.web client.

To start, a simple channel offset script will be executed. This script will create new Image(s) from existing Image(s), applying x, y, and z shifts to each channel independently, as specified in the parameters. To launch the script select the Util Scripts option and select the Channel Offset. This will bring up the script UI as shown below in OMERO.insight.

or in the OMERO.web client.

Using this UI, various options are available.

Exercise 1
  • Try creating a new Image from existing one applying x, y, and z shifts to each channel independently.

9.2 Script Status

Once the Run button is selected the script is launched by the server. This will bring up the activity window with a message telling you the server is executing your script, as shown below:

Alternatively, the activity monitor can also be accessed at any time using the top menu in OMERO.insight Window -> Activities..., as shown here.

Or by clicking STATUS in the top menu bar in OMERO.web, as shown here.

Once a script has finished, the activity window status will be updated to reflect this. At the far right of the activity window there will also be some options that will become available.

Here, our script has finished and we have the option to View, Remove or view the Information about the figure.

or alternatively in OMERO.web we can View the image or Browse back to where the image is attached in the web data viewer.

Exercise 2
  • Try running the Channel Offsets script as described above.
  • Try running Batch Image Export (under scripts > Export) for one or more images. You can use the default settings. Download and open the zip file that is created.

OMERO scripts are the main way to extend functionality of the OMERO system. What scripts are useful for your particular needs will vary from user to user. However OMERO comes with some pre-built scripts: E.g. those described above.

Exercise 3
  • Explore some of the other scripts available.

9.3 Uploading Scripts

Users that have admin rights on the server can upload Python scripts to be run on the OMERO server. This is achieved by using the icon, which brings up the upload script window below:

Using this window, it is possible to locate a Python script to be uploaded. The python script will then become available under the script menu using the folder name it was uploaded from as its group identifier.

The writing of scripts is beyond the scope of this tutorial. Please see Developer documentation.
Document Actions