Open source software for the analysis of corneal deformation parameters on the images from the Corvis tonometer

Background The software supplied with the Corvis tonometer (which is designed to measure intraocular pressure with the use of the air-puff method) is limited to providing basic numerical data. These data relate to the values of the measured intraocular pressure and, for example, applanation amplitudes. However, on the basis of a sequence of images obtained from the Corvis tonometer, it is possible to obtain much more information which is not available in its original software. This will be presented in this paper. Material and method The proposed software has been tested on 1400 images from the Corvis tonometer. The number of analysed 2D images (with a resolution of 200 × 576 pixels) in a sequence is arbitrary. However, in typical cases there are 140 images. The proposed software has been written in Matlab (Version 7.11.0.584, R2010b). The methods of image analysis and processing and in particular edge detection and the fast Fourier transform have been applied. Results and discussion The software allows for fully automatic (1) acquisition of 12 new parameters previously unavailable in the original software of the Corvis tonometer. It also enables off-line (2) manual and (3) automatic browsing of images in a sequence; 3D graph visualization of: (4) the corneal deformation and (5) eyeball response; 6) change of the colour palette; (7) filtration and (8) visualization of selected measured values on individual 2D images. In addition, the proposed software enables (9) to save the obtained results for further analysis and processing. Conclusions The dedicated software described in this paper enables to obtain additional new features of corneal deformations during intraocular pressure measurement. The software can be applied in the diagnosis of corneal deformation vibrations, glaucoma diagnosis, evaluation of measurement repeatability and others. The software has no licensing restrictions and can be used both commercially and non-commercially without any limitations. Electronic supplementary material The online version of this article (doi:10.1186/s12938-015-0027-3) contains supplementary material, which is available to authorized users.


Background
The Corvis tonometer allows for automatic measurement of intraocular pressure (IOP) by means of the air-puff method [1]. This is one of the methods for measuring pressure in the eye which provides much more information than the known techniques used, for example, in the Goldman tonometer or Ocular Response Analyzer (ORA). By using the Ultra-High-Speed Scheimpflug camera [1], the Corvis tonometer also allows for the observation and measurement of other additional biomechanical parameters based on image analysis of dynamic corneal deformations and eyeball responses. Currently, most of the works in the field of ophthalmology [2][3][4] or the mechanics of the eye [5][6][7] are related to the comparison of the results of eye pressure measurements for different tonometers and for various ophthalmic diseases starting with glaucoma [8] and ending with the population of people living in a particular region of the world [9]. For example, the authors in paper [10] analysed patients with high myopia and moderate myopic astigmatism, who were assessed as eligible for surgery and underwent small incision lenticule extraction. In paper [11], virgin and post-photorefractive keratectomy (PRK) eyes were analysed and then the results between these two groups were compared. A similar comparison was done in publications [12,13] for keratoconic and normal eyes, in [14] for three corneal transplantation techniques, or in [15] after corneal refractive surgery. There are also interesting results presented in papers [16][17][18][19][20] which also relate to the comparison of different groups of patients. For example, a very interesting attempt to compare the theoretical simulation results with the actual data was presented in paper [20]. Numerical results in this publication ( [20]) showed that during the air puff deformation, there would be vibrations together with the corneal deformation, and the damping viscoelastic corneal response was able to reduce the vibration amplitude.
The second area (mechanics of the eye) involves modelling of corneal deformations. It is presented in a smaller number of works that still try to explain all complex phenomena occurring in the eye in dynamic states [20]. The software supplied by Oculus Optikgeräte GmbH in addition to intraocular pressure also measures other additional biomechanical parameters such as the location and amplitudes of two applanations. Moreover, the original software (version V 1.00r24) shows the graphs of deformation amplitude and deformation rate over time [21]. Although the new original software (ver. 2.00 V) enables to show additional graphs, e.g. the corneal deformation amplitude separated from the eyeball response amplitude, their quality and repeatability still leave a lot to be desired -for example, negative deformations are obtained or values are off the scale. The complete 3D visualization of corneal deformations over time is not possible.
On the other hand, it is possible to use the methods of image analysis and processing to a sequence of corneal deformation and eyeball response images. The corneal contours, both internal and external, are analysed in subsequent images of the sequence. The result is not only the complete 3D visualization of corneal deformation but also the possibility of automatic measurement of other additional parameters. These are new parameters that are measured irrespective of the software of the Corvis tonometer. The various parameters and methods of their measurement have been described in five publications by Koprowski R. [21][22][23][24][25] and are not cited here. The exact list of these publications and additional measurable parameters that are not available in the original software of the Corvis tonometer are shown in Table 1. In summary, the proposed software enables automatic and reproducible measurement of additional biomechanical parameters unavailable in the original software of the Corvis tonometer. In particular, the proposed software has the following advantages: fully automatic measurement of biomechanical parameters, measurement of: applanation 1 and 2, highest concavity time, peak distance, radius deformation, maximum deformation amplitude, and their 2D visualization, also available in the original software of the Corvis tonometer, measurement of: corneal length changes, ratio -amplitude changes/corneal deformation length, maximum amplitude of the eyeball reaction, maximum amplitude for the frequency >100 Hz, distinction between the left and right eye, asymmetry in the work of muscles (left or right eye) and the absolute of the cornea reactionunavailable in the original software of the Corvis tonometer, 3D visualization of: corneal deformation, eyeball response, corneal steady state (constant component), corneal vibration and the Fourier transform (FFT) of corneal vibration -unavailable in the original software of the Corvis tonometer), full reproducibility of the measured parameters and the correct operation of the program for all the analysed images, full, free of charge, availability of the source codes of the program that can be used without licensing restrictions, lack of functional limitations associated with the development of the proposed program with new elements.
A detailed description of the proposed software is provided in the following sections while the description of the methods of measurement of individual parameters and their diagnostic significance have been described in detail in the aforementioned previous works of the author [21][22][23][24][25].

Implementation
The software has a modular structure that enables to perform easy and quick modifications and additions to the program according to individual requirements. It consists in Table 2 Summary of 5 files used in applications and their purpose Corvis_read_fun.m The function to convert a single 2D image into two waveforms of the contourinner and outer corneal contours The function designed to calculate all corneal biomechanical parameters based on the 3D data of cornea edges for the subsequent images in a sequence

GUI_Corvis_corr_st
The function to convert input file names menu is the "Play" button which allows for automatic viewing of subsequent 2D images in a sequence every 0.1 second.
Current imagethe area of the currently analysed 2D image of the cornea and waveforms of the calculated results. The following colours were used to mark: (1) greencorneal deformation; (2) light blue -static corneal deformation [24]; (3) bluecorneal deformation for frequencies above 100 Hz; (4) red -detected outer corneal contour.
Current plotarea of 3D or 2D graphs depending on the choice in the "Action view" menu. The colour of the 3D graph is dependent on the selected colour palette. Red in the 3D graph highlights the waveform corresponding to the currently displayed 2D image above ("current image" area). In the case of 2D visualization (the choice of "Graph 2D" in the menu "Action view"), there are three 2D graphs: (1) redcorneal response; (2) blueeyeball response, and (3) greenapplanation points. In addition, a blue vertical line indicates the place of calculations resulting from the 2D image displayed in the upper graph.
Slider "sample number" -the slider available to the user which enables to watch subsequent 2D images in a sequence and moved automatically after pressing the "Play" button. The slider operates in the range from 0 to 139 of the viewed image.  Table "Basic"the area of data visualization related to the currently analysed patient (image sequence). A detailed description and interpretation of the individual values are shown in Figure 2. Due to the different image sources, various types of the Corvis tonometers, "pixels" were adopted everywhere as the basic data conversion (unless stated otherwise). The user can freely convert a given unit by using simple operations. In the case of performing filtration with any filter in the "Filtration" menu, all the data will be recalculated. Table "Current"the area of data visualization directly related to the currently viewed 2D image in Current image. Measuring points are also marked with a blue line when selecting "2D Graph" in the menu "Action view". For the same reasons as in the Table "Basic" all values are in pixels.
Matlab (default menu) -Matlab default menu enabling to record, rotate or describe the image. In addition, it enables to print and display the colour palette, zoom in or out the image, and read the values of manually indicated pixels.
The block diagram of the discussed areas of the main application window is shown in Figure 3. Below there are comments on the use and functionality of the proposed software. 2D images and partial results can be enabled or disabled ("Vi" checkbox). It is also possible to implement histogram equalization ("Hist" checkbox). However, this slows down the analysis. After analysing the image sequence or reading ready data from the *.mat file (the program does it automatically), the results appear in the tables "Basic" and "Current". It is now possible to view the results by selecting in the submenu (Menu "Action view") one of the options: "Full deformation", "Eye ball", "Cornea", "Constant", "Oscylation", "Diff static", "FFT" or "Graph 2D". 3D graphs (or 2D graphs when selecting "Graph 2D") corresponding to the choice appear in the "Current plot" window. On these graphs, the coloured line (whose colour depends on the type of the viewed graph) marks the place resulting from calculations for the currently displayed image in the "Current image" area. With the slider placed at the bottom of the application, it is possible to view and analyse each image in the sequence. In the presence of artefacts in images caused by, for example, improperly detected contours of the cornea or noise in the image, median filtering for one of the available masks can be performed -field of "Filtration" Menu. Examples of image sequence analysis results are shown in Table 3 for 140 images in the sequence archived every 231 μs.

Results and discussion
Time analysis of individual modules for Windows 7 Professional, 64-bit with the Intel Core i7-4960X CPU @ 3.60 GHz and HDD 3.5″ SATA III 2 TB) is presented in Table 4. The analysis rate is mainly affected by the processor speed. When reading data the speed of access to the hard drive is also important. For SSD (e.g. SAMSUNG 840 EVO MZ-7TE500BW 2.5″ 500 GB SSD), the total analysis time can be reduced even 10fold. The calculation time is to a lesser extent influenced by the type of Matlab -in this case, Version 7.11.0.584, R2010b and the type of operating system (Windows/Linux). Figure 4 shows examples of rate changes in the median filtering of a data sequence for different mask sizes for 100 tests (500 GB 2.5″ SSD, Intel Core i7-4960X). According to the graph, the filtration times were as follows: for the mask sized 3 × 3 pixels it was 12 ± 0.4 ms, 5 × 5 pixels -31 ± 0.7 ms, 9 × 9 pixels -89 ± 0.8 ms, 11 × 11 pixels -0.13 ± 0.003 s, and 23 × 23 pixels -0.54 ± 0.015 s.
The presented software is currently used in a number of ophthalmic clinics in the world providing new diagnostic quality which is not available in the original software of the Corvis tonometer [21][22][23][24][25]. In particular it enables 3D visualization of the corneal deformation and eyeball response. Ophthalmologists also have new reproducible quantitative information on the frequency of the first harmonic, vibration, difference in the corneal deformation (minimum and maximum amplitude), eyeball response (thus it is possible to detect automatically which eyeball is tested -left/right) and current measurement of the corneal deformation and eyeball response dependent on the viewed 2D image. Practical clinical usefulness of the measured features is described in detail in [21][22][23][24][25]. In particular, the presented software can be used to assess the reproducibility of vibrations or other corneal deformations. As shown in paper [25], the vibration amplitude for subsequent measurements of the same patient is reduced exponentially. In paper [1] describing clinical applications of the Corvis tonometer, and in practice, the analysis of patients with keratoconus, their strong relationship with vibrations can be demonstrated. With the presented program, it will be possible to measure them quantitatively and not qualitatively. In addition, the proposed software will enable to analyse the impact of other ophthalmic diseases on biomechanical parameters. The analysis of a sequence of patients and their statistical analysis, owing to the automatic data record on the disk, will be also possible, which was previously unavailable in the original software. For all the analysed cases there is full reproducibility of the results obtained.  Moreover, some biomechanical characteristics also present in the original software of the Corvis tonometer can be measured. For these selected features (see Table 1 -for example the first and second applanation) there is measurement consistency of 96%. The difference of 4% is due to the resolution error of the analysed image sequences. In successive stages, the software will be extended to new possibilities of measuring newly discovered features. The selected parts of analysis (main window) are shown in Figure 5.

Conclusions
The presented software is only one of the possible solutions to the analysis of data from the Corvis tonometer. Particular attention should be drawn here to the piece of software related to the corneal contour detection. This algorithm is implemented in the function Corvis_read_fun.m. It involves detection of the largest brightness gradient for successive image matrix columns. In most cases, the largest brightness changes occur on the outer and inner edges of the cornea. Also other methods of edge detection can be applied here, for example, the Canny method or Roberts or Prewitt filters [26,27]. However, proper interpretation of the detected edge still remains to be resolved. It is a key issue in the search for the proper waveform of the deforming cornea. Approximation of the cornea with a polynomial of degree 3 or 4 not only can introduce false non-existing contour sections but also smooth excessively its waveform. It is also possible to use here other methods known from other imaging areas [28][29][30]. Readers, by modifying the source code according to their needs, will have the opportunity to carry out this type of research independently. The software can also be extended to the study of a group of patients, Figure 4 Waveform of the filtration rate with an averaging filter for different mask sizes for 100 tests. The average values of median filtering rate for the Intel Core i7-4960X are: for the mask sized 3 × 3 pixels -12 ± 0.4 ms, 5 × 5 pixels -31 ± 0.7 ms, 9 × 9 pixels -89 ± 0.8 ms, 11 × 11 pixels -0.13 ± 0.003 s, 23 × 23 pixels -0.54 ± 0.015 s. database and statistical analysis of a group of patients. Finally, a classifier enabling the classification of specific groups of patients can be proposed [31][32][33][34].
The software can be successfully treated as the basis for analysis of corneal deformation and eyeball response images for the Corvis tonometer. In its current form, the software has the following advantages: (1) full automation of measurement; (2) repeatability of the results obtained;(3) lack of licensing restrictions, and (4) possibility of compilation and program operation beyond the Matlab environment (please see Additional file 2 -GUI.avi).

Availability and requirements
Project name: Corvis new parameters Project home page: not available Operating system(s): Windows, Linux Programming language: Matlab R2010b Other requirements: Matlab, Image Processing Toolbox Any restrictions to use by non-academics: no restrictions The author does not take any responsibility for the consequences of any malfunction of the software.