## 2 Materials and Methods
### Data Preprocessing
If there is more than one highest value found in the column, only the value with the least index number can proceed to the conditional process. Based on our empirical experiment, generally, the pixel intensity inside the optic disc is above 100 (inside the green channel). Hence, we define 100 as the threshold. Once the desired indexes are gathered and stored in the queue, we make 61 \(\times\) 61 rectangles using every index inside the queue as the center of it. These rectangles are like a sample from every area that probably contains an optic disc. Thus, selecting the right sample is important, as it will represent the optic disc. The optic disc area tends to have a higher intensity value than the surroundings. Additionally, the value ranges are not varied. With that being said, we select the most representative sample through two requirements. First, the sample should not have a standard deviation less than the constant. This term's objective is to get a probable optic disc area with the least intensity value variation. Second, it should have the highest mean value among other samples. Both requirements are implemented as shown in Algorithm 2. Figure 6: The differences appeared in (**a**) red channel image, (**b**) green channel image, and (**c**) blue channel image. ```
1:input:import queue
2:initialize queue size to queue size
3: set all queue elements to zero
4: get Area from queue
5:forn = 1 to Total_queue
6:Max = mean value of Area\({}_{n}\)
7:\(SD\) = standard deviation value of Area\({}_{n}\)
8:\(k\) = 0.1 \(\times\) Mean
9:ifSD \(<\) k then\(\rightarrow\) conditional statement to

satisfy the first requirement
10: store \(Man\) to \(\textit{qual}[n]\)
11:endif
12:endfor
13: search the maximum value of \(\textit{qual}\)
14: get the index of the maximum value
15: return queue[index]
16: get \(\textit{ldx}\)
```  
**Algorithm 2** The sample selection process. Note that _qvalue_, _Area_, _Total_queue_, _Mean_, _SD_, and \(k\) stand for array lists to store the mean value, the 61 by 61 rectangles, the total element of the queue, the mean value of the area, the standard deviation (SD) of the area, and the constant. At the end of the process in Algorithm 2, it returns the index of the most representative sample from the queue that we got from Algorithm 1. Moreover, this index will be the coordinate for the center point of the RoI. Following the selection process in Algorithm 2 is the marking of RoI, or in this matter, the area that we conclude to be the optic disc. We mark the RoI with a rectangle of 702 by 702-pixel size using the current index as the center point. To proceed into the preprocessing and segmentation process, we cropped only the rectangle area yielding a 702 by 702-pixel size image with a prospective optic disc area inside. Figure 7a,b illustrate the marked and cropped RoI, respectively. Rol itself is not adequate to perform an optic disc extraction. A segmentation process is needed to get only the optic disc area. Only after that, the optic disc can be eliminated. However, several steps need to be taken to prepare the RoI before the segmentation. These steps are called pretreatment, which comprises red channel extraction, filtering, contrast adjustment, artifact removal, and morphological reconstruction sequentially. This compound is meant to remove any unnecessary artifacts around the optic disc and enhance the shape of the optic disc. Thus, the segmentation process can be more optimal. Figure 8 outlines the sequence of the pretreatment and segmentation process. Figure 7: The illustration of (**a**) the RoI marked by a red rectangle with size 702 by 702 pixels and (**b**) the cropped RoI from the rectangle. The first step in the pretreatment process is to get only the red channel inside of the RoI. Despite the green channel delineating the RFNL, it is not doing much in the case of the optic disc. To describe the shape of the optic disc distinctly, we found that the red channel can do the work for all the images in the dataset.