OMERO: Accessing images from CellProfiler - CellProfiler/CellProfiler GitHub Wiki

Note: the information below was last updated Sept 2017. Further updates may be found here: https://forum.image.sc/t/establish-connection-between-omero-cellprofiler/22438

CellProfiler 2.1.0 has first-class support for loading images from OMERO. The input modules and the LoadData module can refer to images by URL, for instance, the example pipeline on the welcome page loads its images from http://cellprofiler.org/ExampleFlyImages. The first part of a URL (the part before the colon) is the schema. CellProfiler decides which communication protocol to use, depending on the schema; in the case of the example on the welcome page, the schema is HTTP and CellProfiler uses the HTTP protocol to get the image data. For OMERO, the schema that should be used is "omero" and we use the OMERO client library to fetch and load the data.

OMERO URLs have the form, "omero:iid=". You can find the image IDs using either the OMERO web client or the Insight software. As an example, the screen capture below indicates that the image, "Channel1-01-A-01.tif", has an IID of 58038:

OMERO Insight: Image ID: 58038

At present, manually curating the URL list can be somewhat time-consuming, but we are planning to develop plug-ins for Insight that will automatically generate these lists for CellProfiler from within the Insight user interface. The plugin will allow you to select a screen or plate and export an image set list that can be used with CellProfiler's LoadData module.

#Table of Contents

  1. OMERO login credentials
  1. Using OMERO URLs with the Input modules
  2. OMERO URLs and LoadData
  3. OMERO server revisions

CellProfiler will ask you for your OMERO login credentials when you first access an OMERO url, either by viewing it from the file list or by loading it in a pipeline. CellProfiler will create and maintain a session for you based on these credentials until you close the application. You should only need to enter your credentials once. To use the "Log into Omero" dialog, enter your server's name or IP address, the port (usually 4064), your user name and password and press the "Connect" button. The "Connect" button should turn green and the OK button of the dialog should become enabled (see below). Press OK to complete the login.

Log into OMERO

The 2.1.0 CellProfiler release cannot establish a connection to OMERO when running headless. The current trunk build has an --omero-credentials command-line switch. The format of this switch is:

--omero-credentials <keyword1>=<value2>,<keyword2>=<value2>

There are three different ways to connect: by session ID, by user and password and by ice.config file.

  • Connect by session ID: The OMERO team will be integrating CellProfiler with OMERO, launching CellProfiler with a session ID formulated by the server. Generally, the session ID is only accessible programatically - you need to write a script to get it. To connect by session ID, provide the host, port and session ID like this: --omero-credentials host=demo.openmicroscopy.org,port=4064,session-id=00000000-0000-0000-000000000000
  • Connect by user name and password: You can enter the user name and password on the command-line. This is not secure (any user can see your password using "ps" or similar), but it may be appropriate for firewalled environments where user identification is mostly for organization and not for security. Provide a host, a port (optional), a user name and password like this: --omero-credentials host=demo.openmicroscopy.org,port=4064,user=jdoe,password=12345
  • Connect by ice.config: The OMERO client supports connection using a configuration file. Here is a link to an example configuration file: https://github.com/Sophrinix/CellAnimation/blob/2b8dbd6a9f16eda10da656a1ec061a8bd2b963c8/OmeroCode/demo/ice.config . File permissions can be set on the config file to make it accessible only by the user to provide reasonable security. To connect by ice.config, provide the name of the file like this: --omero-credentials config-file=~/ice.config

The Images module has a file list panel of all of the image files in a project. This file list supports URLs including OMERO urls. You can drag URLs from a text document and drop them into the file list. The URLs do not end with image file extensions (like .TIF), so you need to change the "Filter images?" setting to "No filtering" to allow the OMERO urls to be processed further. You should be able to view the image by double-clicking on it and you should be able to extract plate, well, site and channel name metadata from each image using the "Extract from image file headers" method in the Metadata module (press the "Update Metadata" button after selecting the "Extract from image file headers" method).

If your experiment has more than one image channel, you can use the "ChannelName" metadata extracted from the OMERO image to create image sets containing all of your image channels. In the NamesAndTypes module, change the "Assign a name to" setting to "Images matching rules". For the rule criteria, select "Metadata does have ChannelName matching" and enter the name that appears under "Channels" in the OMERO Insight browser. Add additional channels to NamesAndTypes using the "Add another image" button.

The LoadData module reads image sets from a .CSV file. The CSV file has a one-line header that tells LoadData how to use each of the columns of the file. You can load channels from a URL by adding a "URL" tag to this header. The OMERO URLs themselves appear in rows below. For instance, here is a .CSV that loads a DNA and GFP channel:

URL_DNA,URL_GFP
omero:iid=58134,omero:iid=58038
omero:iid=58135,omero:iid=58039
omero:iid=58136,omero:iid=58040

CellProfiler uses Java .jar files built by the OME to connect with the OMERO server. These have to match the server version and that may mean that you have to replace the files distributed with CellProfiler (OMERO 4.4.6) with JARs that work with your server. The files are in the subdirectory, "imagej/jars" (typically C:/Program Files/CellProfiler/imagej/jars for PC). You need to replace blitz.jar, common.jar, model-psql.jar, ice.jar with the versions distributed with the client that works with your server - these are located in the "lib" directory of the client distribution. You also need to replace omero-client-4.4.6.jar with an omero-client JAR that matches your distribution. You may be able to find these at http://maven.imagej.net/content/repositories/public/ome/omero-client/ If you have difficulty finding these files, feel free to contact the OMERO or CellProfiler team for assistance.

⚠️ **GitHub.com Fallback** ⚠️