Simple RGC: ImageJ plugins for counting retinal ganglion cells and determining the transduction efficiency of viral vectors in retinal wholemounts

Simple RGC consists of a collection of ImageJ plugins to assist researchers investigating retinal ganglion cell (RGC) injury models in addition to helping assess the effectiveness of treatments. The first plugin named RGC Counter accurately calculates the total number of RGCs from retinal wholemount images. The second plugin named RGC Transduction measures the co-localisation between two channels making it possible to determine the transduction efficiencies of viral vectors and transgene expression levels. The third plugin named RGC Batch is a batch image processor to deliver fast analysis of large groups of microscope images. These ImageJ plugins make analysis of RGCs in retinal wholemounts easy, quick, consistent, and less prone to unconscious bias by the investigator. The plugins are freely available from the ImageJ update site https://sites.imagej.net/Sonjoonho/.


Introduction
The retina is a thin layer of tissue located at the back of the eye. Its purpose is to receive light focused from the lens, and to convert the light into neural signals to be sent onto the brain ( Figure 1A). The cells that transport these neural signals are known as retinal ganglion cells (RGCs). Injuries to RGCs occur in a variety of ocular disorders that can lead to blindness, and there is a large research community investigating ways to protect these cells from damage.
Retinal wholemounts, the intact removal of the retina from the eye, are the favoured technique to quantify RGC number and to assess the impact of protective treatments, such as gene-therapies ( Figure 1B). However, these studies require the Simple RGC: ImageJ plugins for automated analysis of retinal ganglion cells processing of hundreds of images, each containing hundreds of cells ( Figure 1C).
Manual quantification is labour-intensive, time-consuming and prone to user variation. It is clear that automated quantification improves productivity, accuracy, and reproducibility in research.
There are expensive image processing software that can count and measure colocalisation (e.g. Zen, LAX, Volocity, Imaris). Open-source computational tools for automated image analysis are also becoming increasingly available. For instance, several software packages that count the number of RGCs in naive and injured tissues have been developed in the last five years [1][2][3][4]. There are also freely available co-localisation programs [5][6][7][8][9], but none are optimised for determining viral transduction efficiencies of RGCs in retinal wholemounts. Furthermore, only a few of the above mentioned programmes have the option to batch-process a large number of images.
ImageJ [10][11][12][13] is an open-source program that is commonly used for image analysis in biomedical sciences. ImageJ has a variety of built-in tools to aid image analysis and enables users to create and run their own plugins. However, many ImageJ plugins still require a level of manual analysis with a repetitive workflow. We have therefore developed three ImageJ plugins to automate image analysis from retinal wholemount images.
(1) RGC Counter: this plugin detects and outlines individual RGCs, providing a quick and accurate method to quantify the total number of cells from a single-colour image.
(2) RGC Transduction: this plugin calculates the co-localisation between two colour channels and generates the following output per image: (a) total number of RGCs; (b) number of transduced RGCs (co-localised RGCs); (c) viral transduction efficiency (percentage co-localisation); (d) fluorescence intensity measurement of the Simple RGC: ImageJ plugins for automated analysis of retinal ganglion cells transgene for each transduced RGC. In addition to being able to specify cell size and reduce noise, this plugin makes use of an optional feature that subtracts transduced axons to avoid false positives.
(3) RGC Batch: this plugin is a batch image processor compatible with both 'RGC Counter' and 'RGC Transduction' to improve workflow.
The automated analysis of the first two ImageJ plugins can be previewed in real-time to assist in establishing the parameters. The plugin results can be viewed in ImageJ or exported as CSV and XLSX files.
Taken together, we have created a set of precise, freely available and user-friendly ImageJ plugins for the retinal research community. These plugins will be particularly useful for researchers investigating neuroprotective strategies or assessing the suitability of their gene therapy vectors for inner retina transduction.
Simple RGC: ImageJ plugins for automated analysis of retinal ganglion cells

Overview
ImageJ supports a wide variety of languages for its application-programming interface (API), including Java and Python (Jython). These languages are used to produce a JAR plugin file for users to load into ImageJ. The 'Simple RGC' plugins are written in Kotlin [14], a statically typed programming language designed to fully inter-operate with Java [15]. With ImageJ being developed in Java, its Java API documentation is much more thorough compared to its other supported languages.
Kotlin allowed us to leverage this whilst gaining concise syntax and the addition of powerful functional programming constructs.
The code for 'Simple RGC' is split into an abstraction provided by the ImageJ API: commands and services. Commands are designed to be used for one-off operations, while services are intended to be re-used across images. As a result, the code to handle the user interfaces (UIs) of 'Simple RGC' is provided by commands and the image segmentation steps are encapsulated within services. This structure reduced the amount of duplicated code in our plugins and increases its maintainability.

Installation
'Simple RGC' requires the user to download ImageJ prior to installation. ImageJ, and associated-bundles with pre-installed plugins such as Fiji, can be downloaded at:

User interface and compatibility with microscopy images
We chose to use the ImageJ graphical user interface and API for 'RGC Counter' and 'RGC Transduction', as opposed to implementing a new UI. This was done to ensure that we developed a UI with a similar style and convention to other ImageJ plugins, reducing the learning curve for ImageJ users. This allows for a straightforward and friendly user experience.
All plugins are designed to be compatible with TIFF, PNG and proprietary formats such as Leica Image Files (LIFs). This allows direct export of native images from a microscope to the plugin.

RGC Counter
'RGC Counter' quantifies the total number of cells in an image. The identified cells become highlighted in ImageJ and the cell counts are presented.
Following ImageJ convention, 'RGC Counter' operates on an image that has already been opened. To run the plugin, the user should select 'Plugins > Simple RGC > RGC Simple RGC: ImageJ plugins for automated analysis of retinal ganglion cells Counter' from the ImageJ menu. The user then has the option to manually tune parameters based on cell size and image quality (Figure 2 -User Interface). It is recommended to use the preview button during the initial setup to optimise parameters for the most accurate detection of cells. The plugin will remember the most recently used parameters to improve workflow.
After the user clicks "OK" on the UI, the plugin begins to run. 'RGC Counter' runs a series of steps in order to successfully segment and identify each cell in the selected morphology channel of a fluorescence microscopy image. The steps of the image processing are shown in Figure 2 -Image processing and they are as follows: 1. The colour channel selected by the user is extracted and a grayscale filter is applied.

2.
A local threshold is applied to the grayscale image. At a high level, this operates by moving a small window over the image and setting pixels to white if they are above a certain threshold, and black if they are below. The Niblack's algorithm [16] is implemented at the local thresholding step, as we found that it outperformed Bernsen's [17] and Otsu's [18] on accuracy and image processing speed (data not shown).
3. The third step is optional, and when selected the plugin attempts to remove axons by (a) identifying them using the 'Ridge Detection' plugin [19], and (b) masking them out. It is not necessary to select this optional step when the loaded image contains relatively round structures (e.g. Brn3a, RBPMS, NeuN, DAPI and Hoechst stains), but could improve the quantification output when both cells and neurites are visualised (e.g. eGFP or Tuj1-positive cells). Please note that activation of 'Exclude axons' increases the time duration for image processing. [20] is applied to the image in order to merge erroneously separated cells.

5.
A global threshold is applied to clarify the blurred image. Otsu's algorithm [18] was used at the global thresholding step. We found that Otsu's performed similar to Moment's [21] and Shanbhag's [22] in sharpening images. 6. The watershed algorithm [23] is applied to separate connected cells into individual entities.
7. The final step is based on particle analysis to filter out structures (e.g. debris or artefacts of staining) that are not within the cell diameter range specified by the user, and importantly the identified cells are highlighted and quantified.  'RGC Transduction' requires that an image is opened in ImageJ in order to run the plugin. To run the plugin, the user should select 'Plugins > Simple RGC > RGC Transduction' from the ImageJ menu. The user is required to select the channels for co-localisation analysis, and to specify the image-processing parameters (Figure 3 -User Interface). It is recommended to use the preview button during the initial setup to optimise parameters for the most accurate measurements of transduced cells.
The plugin will remember the most recently used parameters to improve workflow.
'RGC transduction' runs a series of steps that are highlighted in Figure 3 -Image processing. Initially, the image is split into two separate single-channel images, corresponding to the channels for morphology and transduction selected by the user. With the need to identify individual cells across the morphology and transduced channels, the same pre-processing and segmentation pipeline as 'RGC Counter' is applied separately to both channels. Afterwards, co-localisation between Simple RGC: ImageJ plugins for automated analysis of retinal ganglion cells the two channels is calculated. A cell is classified as transduced if at least 50% of the pixels in the morphology channel are also covered by pixels in the transduction channel. This threshold of colocalisation achieved the best performance on the investigated images containing RGCs and the transgene eGFP.
The results output of 'RGC Transduction' can be view in ImageJ's ROI Manager or can be directly saved as XLSX or CSV files. We recommended saving the results in the XLSX format because it will generate one organised file with multiple tables, in contrast to multiple CSV files. Highlights of measurements performed by 'RGC Transduction' are shown in Figure 3  contains the image-processing parameters that were selected for image analysis.
Simple RGC: ImageJ plugins for automated analysis of retinal ganglion cells

RGC Batch
'RGC Batch' is a batch-image processor that allows the user to run multiple image files through 'RGC Counter' or 'RGC Transduction' with minimal user interaction or repetition.
The UI is not built using ImageJ's command interface as done for 'RGC Counter' and 'RGC Transduction'. Instead, we built our own custom UI using the Java Swing framework to circumvent ImageJ UI restrictions. This allowed us to make separate tables for both 'RGC Counter' and 'RGC Transduction'. The user interface of RGC Batch is shown in Figure 4 -User Interface.

Quality control
The Simple RGC ImageJ plugins were validated by comparing the output of each plugin to manual quantification performed by six investigators. The time required to manually process each image was also measured.

Validation of RGC Counter
RGCs from mouse retinal wholemounts were immunolabelled with the RGC marker RBPMS, and images were captured using an epifluorescent microscope at 20x magnification. The number of RGCs per image was manually counted in six images from uninjured-and injured retinal wholemounts by six independent investigators. ImageJ plugin 'RGC Counter' detects and highlights RBPMS-positive cells from the image file and separates overlapping cells (Figure 5A and C). Pearson productmoment correlation analysis demonstrated a strong positive linear correlation between automated-and manual quantifications (Figure 5B and D). The Pearson correlation coefficient (r) was 0.961 for the quantifications of both uninjured-and injured retinal wholemounts images. The time required to manually quantify one image ranged from 2 to 16 minutes, depending on the investigator and number of RGCs per image (Figure 5E and F). In contrast, the automated quantification via 'RGC counter' took less than 20 seconds (Figure 5E and F). Taken together, the ImageJ plugin 'RGC Counter' quantifies the number of RGCs accurately and rapidly.
Simple RGC: ImageJ plugins for automated analysis of retinal ganglion cells

Validation of RGC Transduction
The  Figure 6D). This outcome was not statistically significantly different from manual measurements calculated by the six investigators ( Figure 6D). This result demonstrates that 'RGC Transduction' is sensitive enough to accurately determine the viral transduction efficiency of RGCs in retinal wholemounts.
As an added benefit, we also programmed the plugin to measure the transgene fluorescence intensity from each of the transduced RGCs (see Simple RGC: ImageJ plugins for automated analysis of retinal ganglion cells

Validation of RGC Batch
The functionality of ImageJ plugin 'RGC Batch' was validated by comparing the output of this batch image processor to the results of 'RGC Counter' and 'RGC Transduction'.
The results generated by 'RGC Batch' were identical to 'RGC Counter' (Figure 7A) and 'RGC Transduction' (Figure 7B). This demonstrates that 'RGC Batch' can process multiple images with the same high level of accuracy as the stand-alone plugins. This third plugin makes automated quantification of large data sets more user-friendly by avoiding a repetitive workflow when all images are taken using identical microscope settings.
Simple RGC: ImageJ plugins for automated analysis of retinal ganglion cells

Operating system
Any operating system compatible with ImageJ or Fiji (http://imagej.net).

Programming language
The 'Simple RGC' plugins are written in Kotlin (Version 1.3.50) and ImageJ is written in Java (Version 8 update 251 or later).
Simple RGC: ImageJ plugins for automated analysis of retinal ganglion cells

Additional system requirements
No further requirements.

Dependencies
The plugins are reliant on ImageJ (version 1.53b or later) and the following plugins:

List of contributors
Tiger Cross -Developed, tested and optimised plugins, wrote the manuscript.
Joon-Ho Son -Developed, tested and optimised plugins, wrote the manuscript.
William Burr -Developed, tested and optimised plugins.
Arjun Singh -Developed, tested and optimised plugins.
Kelvin Zhang -Developed and tested plugins.
Andrew Osborne -Performed biological experiments, wrote the manuscript, Transduction' therefore can quantify expression of proteins tagged to a fluorescent marker which may be applicable to drug discovery platforms -measuring protein synthesis, activation, signalling or inhibition following treatment.
The authors of this manuscript are responsible for maintaining the plugins of 'Simple RGC'. We would encourage that potential bugs are reported by creating an issue on the GitHub account (by using the link: https://github.com/sonjoonho/SimpleRGC/issues), or alternatively by contacting the corresponding authors by e-mail.