ALL Metrics
-
Views
-
Downloads
Get PDF
Get XML
Cite
Export
Track
Software Tool Article

Easing batch image processing from OMERO: a new toolbox for ImageJ

[version 1; peer review: 2 approved]
* Equal contributors
PUBLISHED 05 Apr 2022
Author details Author details
OPEN PEER REVIEW
REVIEWER STATUS

This article is included in the Cell & Molecular Biology gateway.

This article is included in the NEUBIAS - the Bioimage Analysts Network gateway.

Abstract

The Open Microscopy Environment Remote Objects (OMERO) is an open source image manager used by many biologists to store, organize, view and share microscopy images, while the open source software ImageJ/Fiji is a very popular program used to analyse them. However, there is a lack of an easy-to-use generic tool to run a workflow on a batch of images without having to download them to local computers; and to automatically organize the results in OMERO. To offer this functionality, we have built three tools in Java language: “Simple OMERO Client”, a library to communicate with an OMERO database from Java softwares ; an ImageJ/Fiji plugin to run a macro-program on a batch of images from OMERO and “OMERO Macro extensions“, a dedicated vocabulary to interact with OMERO in macro-programming. The latter is intended for developers, with additional possibilities using tag criteria, while the “Batch OMERO plugin” is more geared towards non-IT scientists and has a very easy to use interface. Both tools are illustrated with a use case.

Keywords

OMERO, Fiji, ImageJ, Java, Image Analysis, Image processing, Automation, Microscopy

Introduction

Cell biology research is a big provider of multidimensional image data through the use of multimodal microscopy approaches to decipher cellular processes. Photonic microscopes and associated areas of expertise in image analysis are often available in cellular imaging facilities which tend to propose unified tools to manage images and associated projects. Over the last decade many tools emerged which are in constant development: software platforms (QuPath,1 Cell Profiler,2 Icy,3 KNIME,4 napari5), browser-based and collaborative frameworks (ImJoy,6 BIAFLOWS,7 TissUUmaps8), and image databases (BisQUE,9 Cytomine10). While some of this software is focused essentially on the analysis of images and others on their management, the global trend for image analysis in the machine and deep learning era is to use complementary software or platforms integrating a combination of these tools. In this ecosystem, the Open Microscopy Environment (OME) Remote Objects (OMERO),11 and ImageJ/Fiji1214 benefit from a high level of historical implementation in the microscopy landscape involving a large community of users and developers.

OMERO is a complete platform for managing (organizing, editing, analyzing and sharing) images online through dedicated web interfaces, including a viewer for full multi-dimensional image display, a figure editor, analysis with internal scripts and an integrated data mining tool. Over 150 proprietary microscopy image formats are supported. The organisation, browsing and searching of images is eased by multiple cataloguing tools, as data can be annotated with tags, comments, key-value pairs, tables and supplementary files.

To analyse images, OMERO also provides programming APIs for Java, Python, MATLAB and C++ and many image analysis software packages can connect to OMERO via dedicated links or plugins.1,2,15,16 Among these, the OMERO plugin of ImageJ/Fiji17 allow access to the OMERO.insight interface to open and treat an image on local desktops before saving regions of interest (ROIs), results tables and images in the database after a manual or semi-manual sequence of treatment. Although it is easy and common to automate such processing with Fiji via a macro for a folder of images, it is not yet possible to automate all the processes (import/export, saving images, ROIs, results, etc.) through a unique Macro program in ImageJ/Fiji for images hosted in the OMERO database. The only solution today is to write your own processing program according to the example available in the OMERO guide for threshold segmentation on datasets.18 But this is not within the reach of non-IT personnel.

The goal of this work is to ease the access to image analysis for all users who are managing their projects and images in OMERO. Based on an exhaustive library for importing/exporting images and results from and to the OMERO database, named Simple OMERO Client, we propose two ways to interact with the OMERO database using the ImageJ Macro language: (i) through a graphical user interface (GUI) on the same basis as the Batch Process module of ImageJ, that will loop a macro program written for one image on whole datasets, or (ii) using new OMERO buit-in Macro functions to write a macro program that will loop the analysis on datasets. Theses two tools are developed using a new java library, Simple OMERO client, that will also be described in this paper.

Methods

Implementation

Three tools were built: a library, Simple OMERO Client, and two plugins, OMERO Macro Extensions and batch OMERO plugin. All three were written in Java 8 and use Maven19 to handle their dependencies. They all rely on ImageJ. The two plugins depend on the Simple OMERO Client library which was developed to wrap calls to the underlying OMERO Java Gateway, its main dependency.

Simple OMERO Client

Simple OMERO Client is a Java library that we developed to factor code that is often re-used, such as methods to retrieve pixel values or ROI data. It relies on omero-gateway, omero-blitz and omero-model to interact with an OMERO server, but it also depends on formats-api and bio-formats_plugins to handle microscope images locally. Finally, it uses junit4 and Jacoco to run tests which should ensure that the library functions as expected. These tests, however, expect an OMERO server to run locally and are ideally through omero-test-infra, as is the case during the continuous integration (CI) process on the project Github repository, where the source and compiled JAR can be found. The CI also uses SonarCloud and Codecov for code analysis (coverage, quality).

This library often wraps simple calls to the underlying OMERO API, but does contain complex blocks that would otherwise need to be copied to every project, such as:

  • handling key/value pairs or folders,

  • retrieving pixels from OMERO,

  • converting ROIs between OMERO and ImageJ,

  • converting ImageJ results to OMERO tables.

Most OMERO data structures are simply wrapped (Facade pattern), although a Composite pattern was also used to reinstate an inheritance like the OME model and factor common methods shared by several classes when possible (such as shapes, annotations, or hierarchy objects).

OMERO Macro Extensions

The OMERO Macro Extensions plugin only depends on ImageJ and Simple OMERO Client to run. It relies on junit5 and Jacoco for unit tests, although some functions rely on graphical elements (such as the ROI manager) and are not currently tested. The CI process is similar to what is done for Simple OMERO Client, except code analysis that is not performed through SonarCloud or Codecov. This plugin consists of a single class implementing the MacroExtension interface from ImageJ: it defines 22 macro functions to interact with OMERO and acts as a façade for Simple OMERO Client. To do that, it essentially parses String and Long arguments before it calls the appropriate methods from the underlying library.

Batch OMERO plugin

The batch OMERO plugin depends on ImageJ and Simple OMERO Client as well as formats-api and bio-formats_plugins to open images from local files. It also, optionally, relies on scijava-common and scijava-ui-swing to handle script inputs and other script languages, if possible. Currently, no automatic testing is performed and there is no CI. The main plugin window handles the connection to OMERO, displays the objects and collects the input/output while a different class is responsible for effectively running the script on all the images from the selected source and saving the results. A specific class handles the execution of the script file and collects the possible arguments beforehand: if SciJava is available, it will be used, otherwise it will fall back on ImageJ1 functions.

Operation

To operate these tools, respective Maven dependencies need to be available, as well as a Java Virtual Machine (JVM). In practice, the OMERO dependencies can be provided by the OMERO.insight plugin for ImageJ, while the bio-formats dependencies are provided by the corresponding plugin.

Simple OMERO Client

The library will normally be used by developers: the easiest way is to add it as a Maven dependency to the project, as it was done by the ImageJ plugins presented in this paper. If the aim is to use an uber-JAR (including the dependencies) through another language (e.g. Python), the code just needs to be built with Maven: this will produce the desired file. When interacting with ImageJ, it is possible to create tables on OMERO from ImageJ results. The library also makes it possible to transfer ROIs between OMERO and ImageJ. However, as the latter only works with 2D shapes while the former handles 4D data, additional metadata are required to track which shapes belong to the same ROI. The library expects it to be done using a property in ImageJ: shapes that share the same local index for the specified key correspond to the same ROI in OMERO. Moreover, when ROIs are retrieved from OMERO, a second property, with “_ID” appended, is set with the OMERO ID as its value. Moreover, tables created from ImageJ results can have a ROI column linking each line to an ROI if all the lines fulfil one of the following conditions:

  • A column with the same name as the property key contains the corresponding value, and the ROI has an ID property.

  • A column with the same name as the ID property contains the ROI ID.

  • The label contains the name of an ImageJ ROI with those properties set.

OMERO Macro Extensions

Once the OMERO Macro Extensions plugin is installed in ImageJ, along with its dependencies, it can be used through the macro language. When writing a macro using these extensions, the first thing to do is to load the plugin with the following command: run(“OMERO Extensions”);

Connecting to OMERO is done using: Ext.connectToOMERO(“host”, 4064, “username”, “password”);

Then, switching group can be performed through: Ext.switchGroup (groupId);

Afterwards, interacting with OMERO only takes simple commands, such as:

datasets = Ext.list("datasets");

or:

imageplusID = Ext.getImage (imageId);

When done, you can disconnect with: Ext.disconnect();

Batch OMERO plugin

In the same way, the batch OMERO plugin first needs to be installed in the ImageJ plugins folder along with its dependencies. If this plugin is installed in ImageJ2/Fiji, it will make use of SciJava to run scripts using script parameters, otherwise it will only run ImageJ1 macro files, with arguments specified manually. When the plugin and the Simple OMERO Client are downloaded and installed, ImageJ/Fiji launched, a new “Batch process…” menu is added in the Omero plugin menu. When chosen, the GUI (Figure 1) is opened. A connection window to OMERO appears by clicking « Connect » in this window. After connection the drop down menus will be filled by information coming from the default group of the user (Group, user, Project, Dataset). Depending on the saving options (OMERO or local), the window will adapt its output choices.

af83f8c1-a2a8-421e-9361-0ab264ffe7af_figure1.gif

Figure 1. GUI window of the batch OMERO plugin.

The tool can process images retrieved remotely from OMERO or locally from a folder, using Bio-Formats. Conversely, it can save the output on OMERO and/or locally. The main possible outputs are new images, ROIs, results tables, log windows and the user has to specify (Figure 1) what should be saved in accordance with the outputs of the macro.

ROIs can be loaded from OMERO: if this option is chosen (Figure 1), then OMERO ROIs will be exported to the ROI Manager using Simple OMERO Client. 3D/4D ROIs can thus be accessed from macros through two ROI properties: “ROI” and “ROI_ID”, which contain, respectively, the local index and the ROI ID on OMERO for each 2D shape.

When saving to OMERO, the users have to choose an existing project or a dataset they own in the current group.

Furthermore, the following rules apply:

  • If ROIs are saved but images are not, then they are saved to the input image on OMERO, which should be annotable by the user.

  • If images and ROIs are saved, then:

    • For each image, its overlay is imported as well.

    • The last active image obtained with the macro-processing gets the content of the ROI Manager, and the Results tables and log windows will be its associated files.

    • If the last active image is the same than the input image but it cannot be annotated by the current user, then the image is re-imported for the user.

  • If tables are saved to a project, and ROIs were loaded or saved, the tables can have a ROI column, provided they fulfill the requirements from the simple-omero-client library mentioned previously.

Use cases

Batch OMERO plugin

As 2D or 3D segmentation is a general requirement to perform quantification in cellular biology, a use case based on this image analysis procedure is proposed to show all the possible outputs obtained with these tools. So, the batch OMERO plugin and OMERO Macro extensions were tested on a XYZ set of DAPI images obtained from a FluoCells Prepared Slide 3 (mouse kidney section with Alexa Fluor 488 WGA, Alexa Fluor 568 Phalloidin, and DAPI) from ThermoFisher Scientific. Images were acquired on a LSM780 laser scanning confocal (Carl Zeiss, France) through a 63X/1.4 oil immersion objective (excitation 405nm, emission 430-460nm, voxel size 130x130x200nm) and a blind deconvolution was applied using Huygens Remote Manager with a CMLE algorithm (Scientific Volume Imaging, Netherlands). Two macros are available to try the Batch OMERO plugin:

  • “Macro_to_Batch_onOmero_3D”: this program performs 3D segmentation on the image stack of nuclei using the 3D object counter plugin20 after low pass filtering and Otsu thresholding. Then ROI groups are created by gathering objects which have the same label on different slices. At the end, the macro returns the image of labels overlaid with the ROIs, a results Table (Figure 2) and a log window. It can be run by ImageJ1 or ImageJ2/Fiji: in the former case default parameters will be used (predefined minimal sizes of objects, and all images kept at the end). In the latter, as it also uses the script parameters of ImageJ2, the minimal size of the objects can be defined by the user who can decide if images are kept or not at the end of the execution of the macro. These inputs can be displayed and modified through the GUI of the plugin with the “Set Arguments” button. This macro is the generic one called by the next one and the use case macro of OMERO Macro extensions.

  • “Macro_to_Batch_onOmero_3D_IJ1_Arguments”: this macro is only coded in ImageJ1 macro language to get the parameters and calls the previous one. Its goal is to show another way to get input parameters. Indeed, the batch OMERO plugin calls the macro each time an image is opened from a dataset. If it is an ImageJ1 macro containing a dialog box to get input parameters, this one will be displayed at each execution of the macro, by default. This problem can be circumvented by getting the number of times the macro is called by the plugin with the getArguments() command. The dialog box will be displayed at the first call and parameters stored in a text file. They will be retrieved from the file at the next calls.

af83f8c1-a2a8-421e-9361-0ab264ffe7af_figure2.gif

Figure 2. A) Project and Dataset processed by the “Macro_to_Batch_onOmero_3D” B) First image with 2 groups of ROIs displayed (red and yellow) C) View of each ROI of theses groups on the different z positions of the 3D stack D) csv file and Table attached to the Project contaning all the ROI measurements for all the images of the dataset processed.

OMERO Macro Extensions

In this use case, the macro language extension for OMERO is used to show another way to access and process the images through their tags. Two dialog boxes are displayed during the execution. The first one allows the user to log in and define a specific signature keyword to tag the images that will be processed (“IJ_Processed” by default). The second one contains a drop down menu to choose the images that will be processed for 3D segmentation according to their tag, among the tags used in the default user group. If the signature tag already exists, the macro tests if it is linked to the image. If this condition is fulfilled, the image won’t be processed, otherwise it will be linked to the image after processing. When the signature tag is unknown in the user group, it is created and linked to the processed image.

Simple OMERO Client

The expected use case for the library is to use it as a Maven dependency in a Java project, as demonstrated by the two ImageJ plugins presented in this paper. An other use case would be to call it from an ImageJ2 script to access advanced OMERO functions directly from there. It is, for example, short and easy to retrieve the maximum value from images inside a dataset and tag them if the value is between two set thresholds (script available in OMERO toolbox examples).

Conclusion

In this paper we provide new tools to fluidize automatic image processing with ImageJ/Fiji on images managed through an OMERO database. One of the main advantages of these tools is to simplify the macro-programming and give the opportunity to quickly analyze multiple images. Among these advantages, avoiding the tedious image format management when coding Macro programs in ImageJ/Fiji, will accelerate Macro development for end-users and help focus on the essential goal: image analysis. The spirit of the plugin could be considered close to the Batch Process plugin integrated in ImageJ1, as people without any knowledge with Macro language could record their image analysis process and apply it after on all their images. Consequently, we should highlight, that our plugin potentiates the original Batch Process by offering the choice to alternatively work with local folders, like the original one, or the files could be imported/exported from local directories or the OMERO database. The plugin and language extension approaches can be considered complementary, as the language extension will allow more complex processing, including a faster connection without GUI, a tag management of the images for example, allowing selective analyses. Another big advantage will be the delivery of CSV files and tables associated with the Project, which allows the use of the OMERO.parade data mining tool, and particularly the recent parade-crossfilter development.21

Data availability

Underlying data

No underlying data are associated with this article.

Extended data

The Dataset of images dedicated to these treatments and processed with the “Macro_to_Batch_onOmero_3D”, through the Batch OMERO Plugin and their results obtained are available on the public webpage of the OMERO database from Université Côte d’Azur and EMBRC-France, managed by the “Microscopie Imagerie Côte d’Azur” (MICA) Facility and housed by “Institut Français de Bioinformatique” from: https://bioimage.france-bioinformatique.fr/omero-mica/webclient/?show=project-3006.

Software availability

Comments on this article Comments (0)

Version 2
VERSION 2 PUBLISHED 05 Apr 2022
Comment
Author details Author details
Competing interests
Grant information
Copyright
Download
 
Export To
metrics
Views Downloads
F1000Research - -
PubMed Central
Data from PMC are received and updated monthly.
- -
Citations
CITE
how to cite this article
Pouchin P, Zoghlami R, Valarcher R et al. Easing batch image processing from OMERO: a new toolbox for ImageJ [version 1; peer review: 2 approved]. F1000Research 2022, 11:392 (https://doi.org/10.12688/f1000research.110385.1)
NOTE: If applicable, it is important to ensure the information in square brackets after the title is included in all citations of this article.
track
receive updates on this article
Track an article to receive email alerts on any updates to this article.

Open Peer Review

Current Reviewer Status: ?
Key to Reviewer Statuses VIEW
ApprovedThe paper is scientifically sound in its current form and only minor, if any, improvements are suggested
Approved with reservations A number of small changes, sometimes more significant revisions are required to address specific details and improve the papers academic merit.
Not approvedFundamental flaws in the paper seriously undermine the findings and conclusions
Version 1
VERSION 1
PUBLISHED 05 Apr 2022
Views
36
Cite
Reviewer Report 06 Jun 2022
Caterina Strambio-De-Castillia, Program in Molecular Medicine, University of Massachusetts Medical School, Worcester, MA, USA 
Approved
VIEWS 36
GENERAL NOTES
--------------------------
The authors describe three software tools they have developed to facilitate the batch analysis of images that are stored and managed using the popular OMERO data management platform.

The explicit goal described ... Continue reading
CITE
CITE
HOW TO CITE THIS REPORT
Strambio-De-Castillia C. Reviewer Report For: Easing batch image processing from OMERO: a new toolbox for ImageJ [version 1; peer review: 2 approved]. F1000Research 2022, 11:392 (https://doi.org/10.5256/f1000research.121985.r130101)
NOTE: it is important to ensure the information in square brackets after the title is included in all citations of this article.
  • Author Response 12 Sep 2022
    Frédéric BRAU, Université Côte d’Azur, CNRS, IPMC, Valbonne, France
    12 Sep 2022
    Author Response
    LANDSCAPE ANALYSIS:
    Given the potential impact and general interest of the topic and the existence of similar ongoing efforts in the community, in order to avoid confusion it is important ... Continue reading
COMMENTS ON THIS REPORT
  • Author Response 12 Sep 2022
    Frédéric BRAU, Université Côte d’Azur, CNRS, IPMC, Valbonne, France
    12 Sep 2022
    Author Response
    LANDSCAPE ANALYSIS:
    Given the potential impact and general interest of the topic and the existence of similar ongoing efforts in the community, in order to avoid confusion it is important ... Continue reading
Views
47
Cite
Reviewer Report 17 May 2022
Jason R. Swedlow, Division of Computational Biology, Centre for Gene Regulation and Expression, School of Life Sciences, University of Dundee, Dundee, UK 
Approved
VIEWS 47
The authors introduce a set of tools to simplify access to an OMERO server from the ImageJ ecosystem (Java). Similar efforts are on-going in other programming languages e.g. https://github.com/TheJacksonLaboratory/ezomero (Python). This could maybe be mentioned to highlight the fact that ... Continue reading
CITE
CITE
HOW TO CITE THIS REPORT
Swedlow JR. Reviewer Report For: Easing batch image processing from OMERO: a new toolbox for ImageJ [version 1; peer review: 2 approved]. F1000Research 2022, 11:392 (https://doi.org/10.5256/f1000research.121985.r129917)
NOTE: it is important to ensure the information in square brackets after the title is included in all citations of this article.
  • Author Response 12 Sep 2022
    Frédéric BRAU, Université Côte d’Azur, CNRS, IPMC, Valbonne, France
    12 Sep 2022
    Author Response
    The authors introduce a set of tools to simplify access to an OMERO server from the ImageJ ecosystem (Java). Similar efforts are on-going in other programming languages e.g. https://github.com/TheJacksonLaboratory/ezomero (Python). ... Continue reading
COMMENTS ON THIS REPORT
  • Author Response 12 Sep 2022
    Frédéric BRAU, Université Côte d’Azur, CNRS, IPMC, Valbonne, France
    12 Sep 2022
    Author Response
    The authors introduce a set of tools to simplify access to an OMERO server from the ImageJ ecosystem (Java). Similar efforts are on-going in other programming languages e.g. https://github.com/TheJacksonLaboratory/ezomero (Python). ... Continue reading

Comments on this article Comments (0)

Version 2
VERSION 2 PUBLISHED 05 Apr 2022
Comment
Alongside their report, reviewers assign a status to the article:
Approved - the paper is scientifically sound in its current form and only minor, if any, improvements are suggested
Approved with reservations - A number of small changes, sometimes more significant revisions are required to address specific details and improve the papers academic merit.
Not approved - fundamental flaws in the paper seriously undermine the findings and conclusions
Sign In
If you've forgotten your password, please enter your email address below and we'll send you instructions on how to reset your password.

The email address should be the one you originally registered with F1000.

Email address not valid, please try again

You registered with F1000 via Google, so we cannot reset your password.

To sign in, please click here.

If you still need help with your Google account password, please click here.

You registered with F1000 via Facebook, so we cannot reset your password.

To sign in, please click here.

If you still need help with your Facebook account password, please click here.

Code not correct, please try again
Email us for further assistance.
Server error, please try again.