Introduction

The human eye is an optical system that consists of different components with different refractive indexes. Refractive index inhomogeneity leads to ocular aberrations, which make it difficult to observe external scenery clearly and obtain high-resolution retinal image. Liang et al. first introduced adaptive optics (AO) technology, which was originally developed to correct wavefront aberrations induced by atmospheric turbulence, to retinal imaging in 1997 [1]. A fundus camera combined with AO based on Shack-Hartmann wavefront sensor (SHWS) was first developed and in vivo human retinal images with cellular resolution were obtained. Since then, AO has also been combined with optical coherence tomography and scanning laser ophthalmoscopy to significantly improve the quality of retinal image [2,3,4,5,6,7,8].

Wavefront sensing is the basis and premise of wavefront correction in retinal AO imaging, and vision correction with spectacle or laser surgery in ophthalmology. Wavefront sensors used in ophthalmology include SHWS, pyramid aberrometers, Scheimpflug sensors, etc. [9,10,11,12]. Among which SHWS is the most widely [13, 14] used wavefront sensor due to its simple principle, which is mainly consisted of a lenslet array (LA) and a two-dimensional detector [14,15,16,17], but is insensitive to light reflected and/or scattered from a volume within sample and the surfaces of optical components. Coherence-gated wavefront sensing (CGWS) [18] based on the principle of low-coherent interferometry [19] can extract the light backscattered only from a short depth limited by coherence gate within sample [18, 20], and thus it is possible to achieve depth-resolved aberration sensing and correction by using an AO system based on it. CGWS is an interference technique and phase unwrapping is usually required to obtain real phase. However, tissue inhomogeneity often results in phase singularities, which reduce the accuracy of phase unwrapping. By combining CGWS with SHWS, the phase unwrapping is not required and phase singularity is not a problem [13, 21, 22]. CGWS can be combined with both SHWS and virtual SHWS (vSHWS): for the former scheme, the system complexity and the cost, as well as the noncommon path error between beacon and imaging paths are increased [13, 22, 23]; while for the latter scheme, the system is relatively simple because the LA is not used, and the centroid errors due to nonuniform illumination [24] and inaccurate focusing [25] of the LA can be avoided. Therefore, the combination of CGWS and vSHWS is promising for wavefront sensing in biomedical optical imaging [26,27,28,29] and ophthalmology.

vSHWS is a numerical processing method instead of physical components to obtain the wavefront at the pupil. The complex electric field obtained from interferograms is numerically divided into sub-apertures, which are then propagated through a virtual LA to form diffraction spots on its focal plane. The centroids of these spots are estimated, and then the same algorithms as used for SHWS can be used to reconstruct the wavefront [22, 30]. vSHWS’ parameters, including the shape and number of sub-aperture (NSA), the expansion ratio (ER) of electric field zero-padding, the resampling interval and algorithm of data interpolation for the electric field, can be flexibly adjusted to obtain the optimal measurement performance. The optimization method of these parameters was proposed, and a set of optimal parameters was obtained with a set of statistical ocular aberrations in our previous work [30]. Although the aberrations used was the statistical aberrations of 200 normal eyes from a literature [31], it was essentially just one set of aberrations and the obtained optimal parameters were not statistically significant.

The optimal parameters for high-precision aberration measurement of each subject can be obtained with our method proposed previously [30]. Then the statistical results of all the optimal parameters for all aberrations can be calculated, and may be different from the optimal parameters obtained with a set of statistical aberrations, which are currently used for wavefront sensor design. In addition, the statistical aberrations of normal and abnormal eyes are different [32, 33], especially for higher-order aberrations. It is unclear whether the optimal parameters are also different for high-precision aberration measurements of the two types of eyes.

Current instruments used for ocular aberration measurement are almost based on SHWS [33,34,35,36,37], whose LAs are designed according to a set of statistical aberrations and cannot be changed after assembling. It has never been investigated whether the optimal measurement for most or all eyes can be achieved by using such an instrument. vSHWS can be considered as a digitization of SHWS, and its parameters are easy to adjust to achieve high-precision measurement for every subject, thus its statistical optimal parameters can provide a reference for SHWS design.

In this work, a total of 624 sets of optimal parameters including the optimal NSAs and ERs were first obtained for 624 sets of clinical human ocular aberrations. Their statistical results were obtained sequentially, and then compared for normal and abnormal eyes. The optimal combination of the statistical optimal NSAs and ERs, i.e., the statistical optimal parameters, was determined by comparing the performance of some possible combinations. In order to investigate whose performance is better for using the statistical optimal parameters and the optimal parameters obtained with the set of statistical aberrations, the two configurations were used to reconstruct the same wavefronts and then their reconstruction accuracy were compared. The effect of changes in the sampling points of interferograms on the optimal NSA and ER was also investigated.

Method

The used human ocular aberrations were clinically collected at the West China Hospital of Sichuan University and the Eye Hospital of Wenzhou Medical University with commercial aberrometers (Topcon KR-1W, Tokyo, Japan) at a pupil diameter of 6 mm, and a total of 624 sets of aberrations were registered for this study. According to the sequential indices recommended by the Optical Society of America [38], the first eight orders of Zernike coefficients for each set of aberrations were calculated by using Eq. (1).

$$ \Phi \left( {\rho ,\theta } \right) = \sum_{i = 1}^{45} {a_i Z_i \left( {\rho ,\theta } \right)} $$
(1)

where \(\Phi \left( {\rho ,\theta } \right)\) is the aberration at polar coordinates \(\left( {\rho ,\theta } \right)\); \(a_i\) and \(Z_i \left( {\rho ,\theta } \right)\) are the i-th terms of Zernike coefficient and Zernike polynomial, respectively; i = 1 denotes piston aberration.

The first three terms—piston (the zero order), tip and tilt (the 1st order), were excluded because they do not affect seeing and imaging resolution [21]. These aberrations were divided into two groups according to the eye conditions: the normal group consisted of 320 sets of aberrations collected from subjects without pathological features and/or only with refractive error, and the abnormal group consisted of 304 sets of aberrations collected from subjects with various ocular diseases, including amblyopia (n = 29), maculopathy (n = 22), retinopathy (n = 27), glaucoma (n = 45), diabetes retinopathy (n = 82) and diseases those were not accurately diagnosed (n = 99). This study was conducted in accordance with the Declaration of Helsinki. This is a register-based study and the approval of ethical committee is not needed according to Chinese legislation.

The following conclusions have been demonstrated in our previous work [30] and can be directly adopted in this work: square shape sub-aperture is suitable for vSHWS because it is easy to process data and uses as much information of electric field as possible; spline is the most suitable interpolation algorithm, and 0.5 pixels is the suitable interpolation interval by considering the trade-off between reconstruction accuracy and computation burden [30]. The main purposes of this study are to determine the statistical optimal NSAs and ERs, which are the two key parameters for aberration measurement, and then to verify the validity of the obtained statistical results for most or all eyes.

The first step was to determine the statistical optimal NSA. Each set of aberrations was used to generate a preset wavefront that would be reconstructed with vSHWS, and then the preset wavefront was used to generate four interferograms corresponding to the results of four-step phase-shifting interferometry. The interferograms and also the preset wavefronts were sampled by 1020 × 1020 points (close to the pixel number of most common cameras). The electric field at the pupil was calculated by using the four interferograms, and then vSHWS was used to reconstruct the preset wavefront. The source has a center wavelength of 780 nm and a full width at half maximum of 15 nm (broadband source is usually required to reduce speckle in practice). The focal length of virtual LA was set to 10 mm (the reconstruction accuracy is independent of this parameter). The root-mean-square error (RMSE) between the preset and reconstructed wavefronts was used for performance evaluation. RMSE is a parameter used to characterize the deviation between the measured and true values, and is given by

$$ {\text{RMSE}} = \sqrt {{\frac{1}{N}\sum_{i = 1}^N {\left( {X_i - x_i } \right)}^2 }} $$
(2)

where \(X_i\) and \(x_i\) are the true and measured values of the i-th data point, respectively; N is the total number of data points.

Different NSAs were used to reconstruct a preset wavefront, and the NSA corresponding to the minimum RMSE was selected as the optimal NSA for this wavefront. All the optimal NSAs corresponding to all the sets of aberrations were obtained in this way. Then the frequency histogram of the optimal NSAs was obtained, and the NSA corresponding to the highest frequency was determined as the statistical optimal NSA.

The second step was to determine the statistical optimal ER. The RMSE plot varying with ER was obtained for each set of aberrations. The ER corresponding to the minimum RMSE indicating the highest measurement accuracy cannot be simply determined as the optimal ER, because computation burden should also be considered. Therefore, the first derivative of the RMSE plot was calculated to consider the trade-off between the measurement accuracy and computation burden. When the first derivative is equal to or just below a threshold, the corresponding ER was determined as the optimal ER. Sometimes, the RMSE plot does not monotonically drop with increasing ER, and the ER obtained with the above method is greater than the ER corresponding to the minimum RMSE, in which case the latter should be selected as the optimal ER. All the optimal ERs corresponding to all the sets of aberrations were obtained in this way, and then their mean was calculated. The electric field zero-padding for a sub-aperture was not performed during the process of obtaining the optimal NSAs, but NSA was required during the process of obtaining the optimal ERs. There were two options for NSA to obtain the optimal ERs: using the obtained statistical optimal NSA as a fixed parameter for all the sets of aberrations, or using the optimal NSA corresponding to each set of aberrations, i.e., respective optimal NSA. Both of them were performed to find the better one.

All the optimal ERs corresponding to all the 624 sets of aberrations were obtained by using the above method. Then their frequency histogram was obtained, from which the statistical properties (mode, mean and root mean square) could be calculated and used to determine the statistical optimal ER.

The last step was to determine the optimal combination of the optimal NSAs and ERs. Parameter configurations obtained by combining different optimal NSAs and ERs were used to reconstruct all the sets of preset wavefronts. The RMSEs of all the configurations were obtained, and their statistical properties, including maximum, minimum, mean, standard deviation (SD), and root mean square (RMS), were calculated and compared to determine the optimal parameter configuration, i.e., the statistical optimal parameters. The optimal combination is the one that has the smallest statistical properties of the RMSEs. SD and RMS are given by Eqs. (3) and (4), respectively.

$$ {\text{SD}} = \sqrt {{\frac{1}{N}\sum_{i = 1}^N {\left( {x_i - \overline{x}} \right)}^2 }} $$
(3)
$$ {\text{RMS}} = \sqrt {{\frac{1}{N}\sum_{i = 1}^N {x_i^2 } }} $$
(4)

where \(\overline{x}\) is the average of all data points.

In order to investigate whether the performance of vSHWS using the statistical optimal parameters is different from that using the optimal parameters obtained with a set of statistical aberrations, 20 sets of aberrations randomly selected from the 624 sets of aberrations were reconstructed with the above two configurations, respectively. The obtained RMSEs corresponding to the same wavefront were compared to evaluate their performance.

Results

Optimal parameters obtained with statistical aberrations

The current approach to design a SHWS or vSHWS is usually based on a set of statistical aberrations. A set of statistical aberrations including 42 Zernike coefficients (excluded the first three terms) was obtained by calculating the averages of the corresponding coefficients of the 624 sets of aberrations. Different NSAs from 9 × 9 to 20 × 20 were used to reconstruct the preset wavefront generated by using the set of statistical aberrations. The RMSE plot as a function of NSA was obtained and shown in Fig. 1a. The NSA of 10 × 10 corresponding to the minimum RMSE was determined as the optimal NSA. By using the obtained optimal NSA and different ERs from 1.0 to 5.0 times in an interval of 0.2 times to reconstruct the wavefront, a RMSE plot varying with ER was obtained. The threshold of the first derivative of the RMSE plot was set to 3.5 × 10–4 according to our experience to determine the optimal ER. Therefore, the optimal ER was determined to 3.0 times, as shown in Fig. 1b. The performance using this set of parameters would be compared with that using the statistical optimal parameters.

Fig. 1
figure 1

Determinations of the optimal a NSA and b ER for a set of statistical aberrations

Statistical optimal number of sub-apertures

Different NSAs were used to reconstruct the preset wavefronts, and the zero-padding was not performed. The NSA corresponding to the minimum RMSE was selected as the optimal NSA for each preset wavefront, and then 624 optimal NSAs were obtained. The frequency histograms of the above optimal NSAs for normal and abnormal groups were obtained and shown in Fig. 2. For the normal group, the NSAs at the highest (126 times) and second highest (98 times) frequencies are 12 × 12 and 15 × 15, accounting for about 39.4% and 30.6% of the total, respectively. For the abnormal group, the NSAs at the top two frequencies are the same as those of the normal group, 12 × 12 (114 times) and 15 × 15 (110 times), accounting for about 37.5% and 36.2% of the total, respectively. The optimal NSA distributions of the normal and abnormal groups are relatively close, which means that the aberrations of the two groups can be accurately measured by using a same NSA. For the total aberrations including the two groups, the relative frequencies at NSAs of 12 × 12 and 15 × 15 account for about 38.5% and 33.3% of the total, respectively, and are much higher than the frequencies of all other NSAs, indicating that the two NSAs may be the optimal. However, only one NSA can be used in practice, especially for SHWS. Therefore, both the two NSAs were used in the next step to further determine the more suitable one.

Fig. 2
figure 2

Frequency histograms of the optimal NSA

Statistical optimal expansion ratio

The optimal ERs at both the NSAs of 12 × 12 and 15 × 15 were obtained, and the frequency histograms and the statistical properties of these optimal ERs are shown in Fig. 3 and listed in Table 1, respectively. It can be seen from Fig. 3 that the optimal ERs for both the normal and abnormal groups are always close at both the NSAs. As shown in Table 1, both the mean and RMS of the optimal ERs are very close for the two groups. These results suggest that the same ER can be used for high-precision aberration measurements for both the normal and abnormal eyes. In addition, the mean optimal ER (2.60) at NSA of 12 × 12 is smaller than that (2.83) at NSA of 15 × 15, and the former NAS has less computation burden. The following criteria are used to determine the statistical optimal ER: The ER on the abscissa of Fig. 3 (e.g., 2.6 and 2.8 rather than 2.5 and 2.7) adjacent to the mean shown in Table 1 was selected as the statistical optimal ER to facilitate data processing; It is preferable that the selected ER is not smaller than the mode of ERs; When the selected ERs were different for the normal, abnormal, and total groups, the largest one of them should be selected. Therefore, the ERs of 2.6 and 3.0 times were finally determined as the statistical optimal for the NSAs of 12 × 12 and 15 × 15, respectively.

Fig. 3
figure 3

Frequency histograms of the optimal ERs at NSAs of a 12 × 12 and b 15 × 15

Table 1 Statistical properties of the optimal ERs at two fixed NSAs (units: times)

Another set of optimal ERs was also obtained by using the respective optimal NSAs for each set of aberrations. Frequency histograms and statistical properties were obtained, and shown in Fig. 4 and listed in Table 2, respectively. The distributions of the optimal ERs for the normal and abnormal groups are still similar, and the mean ERs for both the groups are very close. These results are consistent with those in Fig. 3 and Table 1, further confirming that it is unnecessary to adjust ER for aberration measurement whether the subject eye is abnormal or normal. The statistical optimal ER was determined to 2.8 times, which differs from those obtained by using the fixed NSAs.

Fig. 4
figure 4

Frequency histograms of the optimal ERs when using respective optimal NSAs

Table 2 Statistical properties of the optimal ERs when using respective optimal NSAs (units: times)

Statistical optimal parameter configuration

So far, two statistical optimal NSAs and three statistical optimal ERs have been obtained below: NSA of 12 × 12 and its corresponding ER of 2.6, NSA of 15 × 15 and its corresponding ER of 3.0, and ER of 2.8 obtained by using the respective optimal NSA. In addition to the first two fixed combinations, ER of 2.8 can also be combined with NSAs of 12 × 12 and 15 × 15. The above four parameter configurations, and a special configuration using the respective optimal NSA and ER, were used to reconstruct the 624 sets of preset wavefronts, respectively. Therefore, five sets of RMSEs were obtained and their statistical results are listed in Table 3. It can be seen that: configuration #3 has two dominant properties (mean and RMS) and not worst property; configuration #2 has two dominant properties (maximum and standard deviation) and one worst property (minimum). Considering that NSA of 12 × 12 is the most frequency in  "Statistical optimal number of sub-apertures" Section, configuration #3 is thus determined as the statistical optimal parameter configuration.

Table 3 Statistical properties of RMSEs obtained with different parameter configurations

Performance comparison

20 sets of aberrations, half from the normal and half from the abnormal groups, were randomly taken out to evaluate the performance of the two configurations: the statistical optimal parameters, and the optimal parameters obtained with the set of statistical aberrations. The 20 sets of preset wavefronts were reconstructed by using the two configurations, respectively. As a reference, the respective optimal parameters of the corresponding aberrations were also used to reconstruct these wavefronts, although it is not available in practice due to its complexity and time-consuming. The RMSEs between the preset and reconstructed wavefronts by using the three configurations were calculated and listed in Table 4. The configuration using the statistical optimal parameters dominates 10 of the total 20 sets, which is close to that (11 dominant) of the configuration using the respective optimal parameters, while the configuration using the statistical aberrations dominates only 1 of the total. As examples, Fig. 5 shows the Zernike coefficient errors of two subjects obtained with the three configurations. It can be seen that: the coefficient errors obtained with the configuration using the statistical aberrations are significantly larger than those obtained with the other two configurations; the coefficient errors obtained with the configurations using the statistical optimal parameters and the respective optimal parameters are close. These results are consistent with those in Table 4, and illustrate that the statistical optimal parameters are more suitable for vSHWS than the optimal parameters obtained with the statistical aberrations, and the performance using the former is even close to that using the respective optimal parameters.

Table 4 Comparison of reconstruction accuracy obtained with different parameter configurations for 10 normal and 10 abnormal subjects
Fig. 5
figure 5

Comparison of coefficient errors obtained with three configurations for subject #2 in a normal and b abnormal groups

Applicability under different sampling points

The most frequent NSA and the ER obtained from the mean of the respective optimal ERs, were determined as the optimal parameter combination. However, they were obtained only at sampling points of 1020 × 1020, and need to be verified whether they are still applicable for other sampling points. Similarly, the 624 sets of aberrations were used to generate preset wavefronts, but the sampling points of the wavefronts were set to 300 × 300, 600 × 600, 900 × 900, and 1200 × 1200 sequentially. The frequency histograms of the optimal parameters corresponding to the above sampling points are shown in Fig. 6, and then the statistical optimal NSAs and ERs were obtained with the same methods as in  "Statistical optimal number of sub-apertures" and "Statistical optimal expansion ratio" Sections. Since the frequency distributions of the optimal parameters for the normal and abnormal groups were relatively close, the two were not separately calculated in this investigation.

Fig. 6
figure 6

Frequency histograms of the optimal parameters at sampling points of a 300 × 300, b 600 × 600, c 900 × 900, and d 1200 × 1200 for same interferograms

For each set of sampling points, five parameter configurations were used to reconstruct all the preset wavefronts, and the statistical properties of their RMSEs were calculated and then compared to determine the optimal parameter combination. The statistical aberrations were also used to obtain a set of optimal parameters as a reference. Table 5 shows the statistical properties of the RMSEs obtained with the three parameter configurations, i.e., the statistical aberrations, the statistical optimal parameters, and the respective optimal parameters, at the four sampling points, respectively.

Table 5 Statistical properties of RMSEs obtained under different sampling points

It can be seen from Fig. 6 that 12 × 12 and 15 × 15 are always the two dominant NSAs, and 12 × 12 is always the most frequent NSA for the four sampling points. We can see in Table 5 that the optimal NSA does not change with the sampling points, indicating that the statistical optimal NSA is suitable for different sampling points. The ERs in both the configurations using the statistical aberrations and the statistical optimal parameters decrease with the increasing of sampling points, the ER (2.8) for sampling points of 1020 × 1020 is the same as that (2.8) for sampling points of 900 × 900, and is greater than that (2.6) for sampling points of 1200 × 1200. Therefore, there is not an optimal ER suitable for all the sampling points, but it can be selected according to the data in Table 5.

Discussion

The data interpolation of sub-aperture electric field can improve the spatial frequency of the diffraction plane, and thus improve the accuracy of centroid estimation and facilitate accurate wavefront reconstruction. However, data interpolation is a time-consuming process and is not conducive to real-time aberration measurement. Because the parameters of data interpolation are relatively fixed and have been determined in our previous work [30], they were not discussed in this work. It should be determined by considering the requirements of measurement accuracy and computation burden whether data interpolation is required. The 20 sets of preset wavefronts used in  "Performance comparison" Section were used to evaluate the impact of data interpolation on the performance of vSHWS. By using the parameters mentioned in the first paragraph in  "Method" Section, the used interpolation algorithm is spline and the interpolation interval is 0.5 pixels. The changes in the accuracy and the average runtimes before and after data interpolation were obtained and listed in Table 6. It can be found that after data interpolation, all RMSEs are significantly reduced, but the average runtimes are increased about 4 times. Using two subjects as examples, the comparisons of the Zernike coefficient errors obtained before and after data interpolation are shown in Fig. 7, and we can see that the coefficient errors of almost every Zernike mode are obviously reduced by data interpolation.

Table 6 Impact of data interpolation on performance of vSHWS
Fig. 7
figure 7

Comparison of coefficient errors obtained before and after data interpolation

It can be seen from Tables 1 and 2 and Fig. 6 that the larger the NSA, the larger the mean of the optimal ERs, regardless of the normal or abnormal group. The reason for this is that the reconstruction accuracy is related to the size of sub-aperture, i.e., the sampling points of the sub-aperture. The numerical propagation of a sub-aperture electric field to form a diffraction pattern requires a two-dimensional Fourier transform, and the spatial frequency of the formed diffraction pattern is positively related to the size of sub-aperture. High spatial frequency of the diffraction pattern results in high centroid-estimation accuracy and thereby high wavefront-reconstruction accuracy. However, the sampling points for the entire electric field is fixed, the NSA is negatively related to the size of sub-aperture. Therefore, a large ER is required for a larger NSA to improve the spatial frequency of diffractive pattern.

It can be found in Table 3 that configuration #5 using the respective optimal parameters corresponding to each set of aberrations, has only one dominant statistical property, which is mainly caused by the selection strategy of ER. The ERs used in configuration #5 were just meet the selection criteria, while the ERs used in configurations #1–4 were selected according to the mean of the optimal ERs. We can see from Figs. 3 and 4 that the selected ERs were greater than most of the optimal ERs obtained under the same conditions. In addition, it is a truth that increasing ER can improve the reconstruction accuracy for most aberrations, as shown in Fig. 1b. Therefore, some statistical properties obtained by using the respective optimal parameters were worse than those obtained by using the statistical optimal parameters.

When the sampling points of the interferograms were not divisible by some NSAs, such as 13 × 13 and 19 × 19, the matrix of the electric field must be cropped. This operation causes a small amount of data loss, which affects the reconstruction accuracy. It may be the reason that 12 × 12 and 15 × 15 were always the dominant NSAs, while the NSAs (13 × 13 and 14 × 14) between them were less frequent, as shown in Figs. 2 and 6. Considering that the amount of data loss is small enough and the interferogram cropping is unavoidable in practice, the conclusions of this study are still valid.

Conclusion

The statistical optimal parameters were obtained by using 624 sets of clinical human ocular aberrations, and the statistical optimal NSA and ER are 12 × 12 and 2.8 times at sampling points of 1020 × 1020, respectively. They are consistent for the aberration measurements of normal and abnormal eyes, illustrating that a fixed set of statistical optimal parameters can be used for high-precision aberration measurement for both normal and abnormal eyes. The statistical optimal parameters are different from the optimal parameters obtained with the set of statistical aberrations obtained from the 624 sets of aberrations, and the reconstruction accuracy obtained with the former is higher than that with the latter. The performance using the statistical optimal parameters is even close to that using the respective optimal parameters corresponding to each set of aberrations, illustrating that high-precision aberration measurement for most or all eyes can be achieved by using a fixed set of statistical optimal parameters. The statistical optimal parameters at other four sampling points were also determined, and the results show that the optimal NSA does not change, while the optimal ER decreases with the increasing of sampling points. vSHWS utilizes the principle of SHWS and is a digitization of SHWS, and thus the findings in this work are not only significant for vSHWS’ design and applications, but also provide reference for SHWS design.