## 2 Materials and Methods  
### ISRI Architecture  
We propose an algorithm and software implementation for the identification and evaluation of four RoIs from retinal images: _OD_, _MA_, _EX_, and _HE_. It can be considered as an intelligent image processing system and diagnosis support for eye diseases. The basic methodology for determination of the mentioned RoIs is texture analysis in small patches (boxes). ISRI has three inputs (retinal image, I; box dimension setting, BDS; and manual box selection, MBS--the last two only for the learning phase) and three outputs (RoI type, RoI; RoI localization, L(_i,j_); and size estimation of RoI, S [%]). The ISRI concept is shown in Figure 1. As can be seen, it has two phases: a Learning Phase (LP), considered as a calibration one, and an Operating Phase (OP), considered as a measuring one. Also, ISRI has an Input Module (IM) for image preprocessing which is active in both phases.  
The IM contains five blocks configured in a pipeline structure: Image Buffer (IB), Decomposition on Color Components (DCC), Primary Processing (PP), Box Division (BD), and Blood Vessel Segmentation (BVS). The retinal image may come from an Image Acquisition Device (IAD) or from an Image Database (DB) and it is stored in the IB to then be processed. First, it is decomposed in color components of RGB and HSV (Hue--Saturation--Value) spaces by DCC. This image is processed by the PP block to improve the representation using the CLAHE algorithm (Contrast-Limited Adaptive Histogram Equalization [38]). Images to be analyzed are further decomposed in boxes by the BD block with the aid of two algorithms: the sliding box algorithm (Figure 2a) and the nonoverlapping box algorithm (Figure 2b). The box dimension is manually selected (Box Dimension Selection, BDS) depending of the image resolution, the algorithm for division, and the type of RoI. The last operation in this initial image processing phase is the blood vessel segmentation by the BVS block.  
The LP contains two successive steps: Step 1, calculating the values of a set of features for the regions of interest (Feature Calculation module, FC); and Step 2, selecting effective features for class representation (Feature Selection module, FS). For the LP, manually selected boxes are used (Manual Box Selection, MBS). There are also two successive steps in the OP: Step 1, calculating the values of the selected features corresponding to different RoIs for the boxes extracted from the input image (Computing Selected Features module, CSF); and Step 2, assigning the class label to the RoI (Classifier module, C). RoI_C selects the box type (_OD_, _MA_, _EX_, _HE_) as a consequence of the RoI classifiers' decisions. The size evaluation of the detected RoI is done by segmentation and \"1\"s counting in the RoI_E block. RoI localization is done by the RoI_L block as the position of the upper corner (_ij_) of the investigated box.  
In order to calibrate and test the system, two well-known public databases were used: STARE [43] and MESSIDOR [47]. They contain both healthy subjects and pathological cases with abnormalities. The STARE database consists of 400 retinal images captured by a TopCon TRV-50 fundus camera. It also contains two sets of manual segmentations obtained by two ophthalmologists used as references. The MESSIDOR database contains three sets of eye fundus images (1200 color images extracted with a color video 3 CCD camera on a TopCon TRC NW6 nonmydriatic retinograph with a 45 degree field of view) with 8 bits per color plane at 1440 \(\times\) 960, 2240 \(\times\) 1488, or 2304 \(\times\) 1536 pixels. Each image is in TIFF format and has an associated medical annotation.