# Advanced Analysis of Electoretinograms Based on Wavelet Scalogram Processing
## 3 Materials and Methods
### Features of Electroretinogram Signals  
The classical analysis of the ERG signal is based on the assessment of amplitudes \(a\) and \(b\), and latency \(l_{a}\) and \(l_{b}\) in the \(a\)- and \(b\)-waves (Figure 1a). In addition to the analysis of classical parameters of the ERG signal, it is proposed to extract the parameters from the wavelet scalogram (Figure 1b). To obtain the coupled components of the ERG signal, it is necessary to perform the following processing of the wavelet scalogram (the corresponding illustrations are shown in in Figure 2):  
* Convert the wavelet scalogram values (Figure 2a) into 8-bit encoding format (a value range from 0 to 255).
* Image binarization using the Otsu method (Figure 2b).  
* Image erosion with a 3 by 3 pixel kernel removes the local artifacts associated with digital signal processing. The erosion of the image allows enables pixels at the boundaries of the segments to be removed. (Figure 2c).
* Determine the connected components of the wavelet scale using the connected components function from the OpenCV library (Figure 2d).  
Mathematically, the connected components represent a set of numbers called Markers. These Markers are arrays of numbers that have the same size as the original image. The Markers carry the affiliation of each point of the wavelet scale chart with a particular segment. The wavelet scalogram was evaluated using the CWT (continuous wavelet transform) function of the PyWT library [22]. The image reprocessing, binarization, and separation in connected components were performed using the respective functions of the OpenCV library [23].  
Figure 1: Amplitude–time (**a**) and frequency–time (**b**) representations of the electroretinogram signal.  
Figure 2: _Cont._  
Table 1 describes the parameters extracted from the wavelet scalogram of ERG, divided into segments from 1 to 6 (Figure 1b).  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Designation** & **Name** & **Description** \\ \hline \multirow{3}{*}{\(B_{max}\)} & maximum brightness of the wavelet & estimation of the segment amplitude \\  & scalogram segment & in the selected frequency and time \\  & & scalogram segment & domains over the entire area \\  & & (Figure 3a) \\ \hline \multirow{3}{*}{\(f_{r},t\)} & \multirow{3}{*}{frequency and time of the maximum region of the wavelet scalogram segment} & estimation of the frequency–time coordinates of the maximum area of the analyzed segment associated with the prevalence of the specific cells or cellular structures contribution \\  & & (Figure 3b) \\ \hline \multirow{3}{*}{\(A_{median}\)} & median brightness values of wavelet & evaluation of brightness distribution over the entire area of the analyzed segment (Figure 3c) \\ \hline \multirow{3}{*}{\(A_{mean}\)} & mean brightness values of wavelet & assessment of segment displacement and uniformity of brightness distribution over the entire area of the analyzed segment (Figure 3c) \\ \hline \multirow{3}{*}{\(t_{1},t_{2},f_{1},f_{2}\)} & frequency and time extremes of the wavelet scalogram segment & evaluation of the spatial location in the analyzed segment on the wavelet scalogram (Figure 3d) \\ \hline \multirow{3}{*}{\(t_{1_{0}},t_{2_{0}},f_{1_{0}},f_{2_{0}}\)} & frequency and time extremes of the wavelet scalogram 90\% segment & evaluation of the spatial location of the analyzed segment, where amplitude is higher than 90\% of maximum value \\ \hline \hline \end{tabular}
\end{table}
Table 1: Parameters of electroretinogram signal.  
Figure 2: Illustration of the steps for wavelet scalogram connected components’ determination: (**a**) Wavelet scalogram; (**b**) Binarized scalogram; (**c**) Filtered binarized scalogram; (**d**) Components extraction.