BatchDeconvolution : a Fiji plugin for increasing deconvolution work ﬂ ow

: Deconvolution microscopy is a very useful, software-based technique allowing to deblur microscopy images and increase both lateral and axial resolutions. It can be used along with many of fluorescence microscopy imag-ingtechniques.Byincreasingaxialresolution,italsoenables three-dimensional imaging using a basic wide-field fluorescence microscope. Unfortunately, commercially available deconvolution software is expensive, while freely available programs have limited capabilities of a batch file processing. In thisworkwe present BatchDeconvolution ,a Fiji plugin that bridgestwoprogramsthatweusedsubsequentlyinanimage deconvolution pipeline: PSF Generator and Deconvolu-tionLab2 , both from Biomedical Imaging Group, EPFL. Our software provides a simple way to perform a batch processing of multiple microscopy ﬁ les with minimal working time required from the user.


Introduction
Fluorescence microscopy is one of the most commonly used techniques in life sciences. The use of fluorescent probes allowed to tag specific proteins and structures within live or fixed cells and image them with high contrast and resolution [1]. Using a relatively low-cost fluorescence microscope, it is possible to achieve the lateral resolution as low as 200 nm [2]. Unfortunately, it is much harder to reach high resolution along the Z optical axis, therefore three-dimensional (3D) imaging is much more challenging [2]. There is a number of microscopy techniques allowing 3D imaging, such as confocal microscopy,3Dstructuredilluminationmicroscopy, 3D stochastic optical reconstruction microscopy/photoactivated localization microscopy or light sheet microscopy, but most of them require additional, usually expensive, modules, which have to be mounted on a microscope [3].
Deconvolution microscopy is one of a few techniques that do not require any additional hardware. Based on a computational image reconstruction, it can improve both lateral and axial resolutions, allowing 3D imaging without any additional equipment cost [4]. Nevertheless, one of the main drawbacks of this technique is the requirement of vast amount of calculations, what significantly extends image preparation time [5]. Secondly, in comparison to other techniques, the intensity-based quantitative analysis on deconvolved images is much more challenging due to nonlinear operations required for image reconstruction [6].
An image of a single bright point is visible as a characteristic diffraction-based pattern called point spread function (PSF) ( Figure 1A) which is specific for every optical set-up [4]. It is shaped due to physical limitation of light, physical limitations of imaging environment, and also defects and imperfections present in the imaging system. An image of a physical object (e.g. a cytoskeleton or an organelle) is a superposition of many single bright points convolved with the PSF [4]: The goal of deconvolution algorithms is to reverse this process. There are two ways of obtaining a PSF. First is to measure the actual PSF on a microscope using, for example, nanometre-sized fluorescent beads [7]. This solution accounts for many of the deviations in the experimental set-up (such as flaws in the optical pathway), but the resolution of the PSF is limited by a signal-to-noise ratio, and it requires a demanding experimental procedure [7,8]. The second approach is to calculate a theoretical PSF using one of the models approximating the optical set-up [8]. It is not restricted by the resolution limitations and it is noise free but usually cannot imitate defects of the optical set-up, as well as the experimental one [5]. Moreover, depending on the complexity of the model and its accuracy, the calculations can be highly time consuming. Whether it is better to use an experimental or a theoretical PSF it needs to be evaluated on a case-by-case basis [5].
There are several deconvolution algorithms that depend on different approaches and mathematical models and have different strengths and limitations [4,9]. Most of them (if not all) carry out calculations in Fourier space to simplify operations [10]. Deconvolution can be applied to regular widefield microscopy and also to standard 3D techniques, such as confocal microscopy, in order to further increase contrast and resolution ( Figure 1B) [11,12]. Beside reducing out of focus light, deconvolution can also be used for deblurring single-slice images.
There are several commercially available deconvolution software such as Huygens (Scientific Volume Imaging) or AutoQuant X3 (Media Cybernetics) allowing batch processing of many images. Their main drawback is their high cost. There are several free, usually opensource, alternatives, such as DeconvolutionLab and DeconvolutionLab2 (Biomedical Imaging Group, EPFL) [9], Iterative Deconvolve 3D (OptiNav) [13], or Parallel Iterative Deconvolution (Piotr Wendykier) [14]. They are in general less user-friendly than commercial ones and they have limited batch processing capabilities, especially in cases requiring more than one PSF such as multichannel images.
The microscopy image acquisition-analysis pipeline can be separated into several stages, that, to some extent, might be automated ( Figure 1C). One of the facts advocating for automatization, is that it increases data processing reproducibility. Furthermore, it also serves as an additional pair (or rather many pairs) of hands allowing one to address one's attention to other matters, after starting calculations.
In this work, we present BatchDeconvolution a bridging Fiji plugin, allowing a batch processing of multiple optical microscopy images. The software employs currently available programs and plugins for PSF generation and deconvolution, binding them together, providing a userfriendly deconvolution platform of multiposition, timelapse, multichannel, z-stack raw ("straight from a microscope") image files.  [22]. The green lines show the orientations of the cross-sections. Image saturation level was set to 0.01 (high saturation). PSF generation parameters: NA = 1.4, n i = 1.518, n s =1.33, λ = 561 nm, t i = 170 µm, z p = 2,000 nm. Based on a study by Kirshner et al. [8]. Panel B shows an example of a deconvolved image of immunofluorescence staining of proteasomes (PSMA2 marker) in MDA-MB-231 cells (full description in a study by Baster et al. [20]). The image was collected as a z-stack of 21 slices, one of the representative intermediate slices is presented. The brightness and contrast parameter was chosen to cover 50-99% of the pixel brightness histogram, separately in the predeconvolution and postdeconvolution images. Mpl-inferno LUT was used. Panel C shows the microscopy image acquisition-analysis pipeline. After acquisition, depending on a type of microscopy and analysis required, image may be enhanced (e.g. reconstructed or deconvolved) and then subjected to image analysis, or analysed without any additional intermediate steps. The final step is the data extraction, statistical analysis (if applicable), and preparation of a figure for presentation. Each of the steps can be automated to some extent.
The software was developed using Java 1.8 (Oracle) in NetBeans IDE 8.2 environment (Oracle). It was tested using Fiji [15] and ImageJ [16].

Results and discussion
During our research in the field of cell migration and mechanotransduction, we have found that using elastic polyacrylamide gels [17] to mimic tissue stiffness causes blurring and distortion of microscopy images. It is a result of a more complex optical set-up than in a case of cells plated directly on a glass or a plastic substrate. This phenomenon impedes the analysis of obtained images. By applying image deconvolution, we were able to improve quality of these images. Unfortunately, at that point none of the freely available software allowed us a batch files processing to the satisfactory extent. Furthermore, because we were often collecting confocal images of different image and voxel sizes, we needed to calculate a PSF matching every of our images. To address this problem, we checked several ImageJ/Fiji plugins allowing to calculate a theoretical PSF and to deconvolve images. We determined that the most suitable programs to use in a batch processing would be PSF Generator [8] and DeconvolutionLab (and later DeconvolutionLab2, that was applied in the final version of our software) [9] from Biomedical Imaging Group, EPFL. First, both are accessible from a command line (Fiji or system), what is essential for scripting. Secondly, they both offer a vast range of algorithms and a userfriendly environment. Although, DeconvolutionLab and DeconvolutionLab2 provide an option of batch image processing, their application is limited. Thus, we decided to develop a separate software that would meet our requirements (see Table 1 for comparison of batch processing algorithms properties between programs).
We implemented both programs into our new bridging Fiji plugin we named BatchDeconvolution. The graphical user interface was created to mirror most of the options from the base programs (Supplementary Figure 1). We implemented also BioFormats repository [18] to enable read-out of most of the popular image formats including their metadata. The access to metadata allowed us to process images of a different voxel and image sizes and number of time points. Therefore, the only common parameter between image files has to be their channel structure which is defined ununiformly between file formats. Because calculations create a high amount of intermediate data (from 2 to 9 times of the size of the original data), we made our plugin to process files in a sequential manner with several check points allowing to delete expendable files (Figure 2, Supplementary Data: Pseudocode). We also implemented option for providing an external PSF (e.g. experimental).

Algorithm testing
We checked our software at all crucial stages of the development for generating results identical to the ones Table : The comparison of batch processing properties of different software.

Batch image processing
Yes (processing of the whole directory) Yes (each file has to be scripted separately) Yes (processing of the whole directory)  [19]. We run the tests on Personal Computers with at least 16 GB of RAM. All the files that met the software requirements (especially: the requirement of an image to have a defined scale; and in case of a multiposition file, the requirement all of images in the file to have the same structure) passed the test. Due to the implementation of BioFormats library, we expect that our program will read all the formats covered by the library. The software has been routinely used (one bachelor thesis, one published article [20], two manuscripts in review, two manuscripts in preparation) on several different Personal Computers, at different stages of the program's development. Images, that we used, were collected using Nikon wide-field fluorescence microscope or Nikon A1 confocal microscope with NIS Elements Software, Zeiss LSM 710 confocal microscope with ZEN Black software, or Zeiss wide-field fluorescence microscope with ZEN Blue software (.tif, .nd2 and .czi file formats). During our work, we found that only the amount of RAM is crucial for the proper execution of calculations. We were using Personal Computers with the memory of 4-32 GB. In a small number of cases of processing large images on low-memory computers, the software was unable to finalize calculations. Running the software on a higher-RAM computer usually solved the problem. Furthermore, when we had tried to run the stand-alone base software with the same files and parameters, we got the same errors. Thus, we believe that our bridging algorithm has no or a marginal influence on the calculations performance. Other computer components affected calculations only in regard to computing time.

Conclusions
In our work, we bridged PSF Generator and Deconvolu-tionLab2 programs with a Fiji plugin, and we named it BatchDeconvolution. We found our solution very useful for processing and analysing large amount of microscopy images. BatchDeconvolution provides a user-friendly, intuitive interface, allowing to process a large number of images without a requirement of any additional Fiji scripting. Applying BioFormats repository allows the software to access metadata of many file formats, that simplifies preparation of program input files and parameters.

Footnotes Citation
We would like to emphasize that while citing our software, PSF Generator [8] and DeconvolutionLab2 [9] should be cited as well.

Access
The source code and the build version of our software are available to download from https://github.com/Mechano biology-Lab/BatchDeconvolution.

Troubleshooting
(1) While testing, we found that repetitive calling Decon-volutionLab2 from Fiji command line causes memory build-up within the system. We overcome that by calling DeconvolutionLab2 externally from the system command line. The drawback of that solution is that Fast Fourier Transform library JTransforms [21] that was called by DeconvolutionLab2 through Fiji, is no longer available. (2) BatchDeconvolution was designed and tested with a fresh installation of Fiji. It is incompatible with a clean version of ImageJ.