## Primary indices

The first step to calculate the indices is to compute the best-fitting circle (with center \(C_k\) and (average) radius \(AR_k\)) for each ring, with \(k \in \{1, \dots, N\}\). This is done by least-squares fitting of a general circle equation to the Cartesian coordinates of data points in ring \(k\) and then, the geometrical parameters (center and radius) are computed from the coefficients (see Ahn, Rauh, and Warnecke (2001) and Ramos-López et al. (2011) for more details). These centers and radii contain information about the displacement or off-centering of the mires, as well as their size and regularity. A high level of drift or variability in these parameters is a signal of corneal irregularity (Ramos-López et al. (2011)).

From the best-fitting circle centers \(C_k\), \(k \in \{1, \dots, N\}\), a regression line can be adjusted to their coordinates (\(y\) over \(x\)), yielding a slope \(m\) and an intercept (which is not used). This line contains information about the direction of the displacement of the centers, which can be a signal of keratoconus (more specifically, the upper-bottom or north-south asymmetry is a marker for keratoconus, see Ramos-López et al. (2013)).

One can find also the best-fitting ellipses (with centers \(\tilde{C}_k\) and axis ratio \(c_k\), i.e., ratio or quotient between the major and the minor axis) for each ring (\(k \in \{1, \dots, N\}\)). This process is also based on a least-squares fit of the general ellipse equation to the Cartesian coordinates of data points of mire \(k\) (see Ahn, Rauh, and Warnecke (2001) and Ramos-López et al. (2011) for more details). A high level of variability in the axis ratio is also a signal of corneal irregularity (Ramos-López et al. (2011)).

Using the quantities, we can define four corneal irregularity indices, labeled as \(PI_1, PI_2, PI_3\) (from *Placido Irregularity indices*) and \(SL\)^{1}:

\(PI_1\) \[ PI_1 = \frac{1}{N} \max_{1 \leq n,m \leq N}{ \|C_n - C_m \| } \] This index measures the diameter of the set of centers \(C_k\) (normalized by the total number of rings \(N\)), where \(\| \cdot \|\) is the standard Euclidean norm in \(\mathbb R^2\). A high value of this index shows a large displacement or off-centering between the mires.

\(PI_2\) \[ PI_2 = \frac{1}{N-1} \sum_{1 \leq n \leq N-1}{ \|C_{n+1} - C_{n} \| } \] corresponds to the total length of the path connecting consecutive centers. \(PI_2\) measures the accumulated drift between each pair of mires. In some cases, \(PI_1\) (diameter) can be relatively small but the centers drift a lot from a mire to the next. \(PI_2\) is able to capture this kind of irregularity, which is an abnormal sign.

\(PI_3\) \[ PI_3 = \sqrt{ \frac{1}{N} \sum_{1 \leq k \leq N} { (c_k - \overline{c})^2 } }, \quad \text{where} \quad \overline{c}=\frac{1}{N} \sum_{1 \leq k \leq N} c_k \] is the standard deviation of the distribution of axis ratios, so that it measures the variability of the axis ratios or eccentricities of the individual rings. A large value of \(PI_3\) indicates a high variability in the shapes of the rings, and thus it is a signal of irregularity.

\(SL\) \[ SL = |m| \] is the absolute value of the slope of the best-fitting line to the coordinates of the centers \(C_k\). High values of this index correspond to vertical mire displacements whereas low values correspond to horizontal displacements.

Apart from these 4 indices, we also take as irregularity indices the values of \(AR_k\) (average radius of the \(k\)-th ring) corresponding to the first (innermost) 5 rings. These values also showed a certain sensitivity for detecting keratoconus (Ramos-López et al. (2011)).

### Normalization of the primary indices

In order to obtain indices with values in the same range (more easily comparable and to prevent scale problems when combining them), a normalization of each primary index was performed (Ramos-López et al. (2011) and Ramos-López et al. (2013)). To do it, these indices were tested on a real dataset of corneas of different conditions. Then, their values were linearly translated to \([0,100]\), so that the value corresponding to the best possible condition (less irregularity) was transformed to \(0\), and the worst (more irregularity) to \(100\). Therefore, in the test dataset, the values of all primary indices were between \(0\) (best-case) and \(100\) (worst-case).

In practice, after the transformation, most index values for any cornea will be in \([0,100]\), but in some particular cases, they may be outside that interval. To facilitate their interpretation, we can assume that values below zero correspond to zero, and the maximum irregularity is attained at a certain value (e.g. 150, this value is discussed in Ramos-López et al. (2011)).

The normalization coefficients used in the previous studies (Ramos-López et al. (2011) and Ramos-López et al. (2013)) were the following (for notation simplicity, values on the left-hand side of the expressions represent normalized values whereas values on the right-hand side are values before the normalization (as computed by their definitions above)):

\[ PI_1 = 12368.3980719706 PI_1 - 12.5200561911951 \] \[ PI_2 = 9699.23915314471 PI_2 - 18.2916611541283\] \[ PI_3 = 5233.70399537826 PI_3 - 13.7375152045819\] \[ SL = 50 SL\]

\[ AR_1 = -1961.92346976023 AR_1 + 444.770836424576 \] \[ AR_2 = -562.8465909984122 AR_2 + 279.7430721547980 \] \[ AR_3 = -486.9218093835968 AR_3 + 331.3137688964757 \] \[ AR_4 = -318.192614292727 AR_4 + 298.064078007947 \] \[ AR_5 = -288.4037960143595 AR_5 + 321.4180137915255 \]

Thus, after the normalization (and possible truncation of extremely high or low values), all indices values lay in \([0,150]\), with \(0\) corresponding to the most normal case and \(150\) to the most irregular case. This value of \(150\) is arbitrary and could be changed (increased or lowered), but we found it performed well in practice (Ramos-López et al. (2011) and Ramos-López et al. (2013)).