Cyst Detection and Motion Artifact Elimination in Enface Optical Coherence Tomography Angiograms

Featured Application: Cysts detection in the retina is of crucial importance for the correct evaluation of microvascular impairment in patients with macular edema on images acquired by optical coherence tomography angiography. We describe a fully automatic method for cysts detection able to compensate for the presence of motion artifacts. Abstract: The correct detection of cysts in Optical Coherence Tomography Angiography images is of crucial importance for allowing reliable quantitative evaluation in patients with macular edema. However, this is a challenging task, since the commercially available software only allows manual cysts delineation. Moreover, even small eye movements can cause motion artifacts that are not always compensated by the commercial software. In this paper, we propose a novel algorithm based on the use of filters and morphological operators, to eliminate the motion artifacts and delineate the cysts contours/borders. The method has been validated on a dataset including 194 images from 30 patients, comparing the algorithm results with the ground truth produced by the medical doctors. The Jaccard index between the algorithmic and the manual detection is 98.97%, with an overall accuracy of 99.62%.


Introduction
Optical Coherence Tomography Angiography (OCT-A) is a relatively new imaging technique, introduced in ophthalmology for a non-invasive evaluation of patients affected by different retinal disorders. In particular, OCT-A has been recently used for a detailed evaluation of capillary networks at different levels of depth, in vascular, inflammatory and degenerative diseases of the retina and the choroid [1][2][3][4]. Images acquired by commercially available OCT-A instruments are represented in gray scale, where pixels can have values ranging from 0 to 255. The presence of signal, i.e., detected blood flow, is associated with the white color, while the absence of signal (due to non-perfused areas and the presence of cysts and/or artifacts) appears as a dark color.
Limited data exist in the literature on the use of OCT-A in patients with Macular Edema (ME) [5][6][7][8][9], a condition that consists of fluid accumulation in the central retina (macula), with a consequent increase in retinal thickness [10]. Cystoid macular edema (CME) is a specific subtype of ME, characterized by the presence of well-defined, intra-retinal, optically empty spaces on structural OCT (cysts) [11]. On OCT-A, cystoid spaces have been described as oblong areas, devoid of signal, appearing black on enface OCT-A angiograms, that can displace retinal vessels [12]. The presence of intra-retinal cysts can make it difficult to perform a correct evaluation of microvascular changes occurring in ME, and in particular the quantification of areas of retinal reduced/non-perfusion, as black areas corresponding to cysts could be easily mistaken for dark areas of non-perfusion in automatic analyses [12]. Therefore, a need exists to find new methods of image analysis, able to exclude artifacts due to the presence of intra-retinal cysts, in order to obtain a more accurate quantification of microvascular impairment. Software implemented in commercially available OCT-A instruments only allows the manual delineation of the margins of the cysts; thus, the development of an automatic method to detect and exclude intra-retinal cysts would be of much help in the analysis of OCT-A images. Moreover, it would allow an automatic quantification of the total area occupied by the cysts in different retinal layers (useful in monitoring the response to different treatment options).
Another important issue in the analysis of OCT-A images is the presence of motion artifacts (consequences of even small movements of the eye); typical motion artifacts are represented by line defects, with losses of detail and image distortions [13]. Even if the currently available software techniques largely compensate for these types of artifacts, they can still be a problem in patients with low visual acuity, poor fixation or poor cooperation. Even in this case, the development of an automatic method for removing motion artifacts would be useful in the analysis of OCT-A images.
In the present paper, a novel and automatic method for cyst detection in both the superficial and deep capillary plexuses (SCP and DCP), based on filters and morphological operations, is reported. The same method also aimed to remove motion artifacts, if present. The method has been tested on a wide dataset, and the results have been compared with the ground truths provided by expert medical doctors. The proposed method achieves an accuracy of 99.62%.

Image Acquisition
A total of 194 OCT-A images, of both the SCP and DCP of 30 patients with CME and nonproliferative diabetic retinopathy, and with or without motion artifacts, were included in the analysis. Each patient was evaluated at the baseline and after 6 months. Inclusion criteria for the study were: male or female ≥ 18 years of age with center-involving cystoid macular edema and good quality imaging. The study adhered to the tenets of the Declaration of Helsinki and was approved by the institutional Ethics Committee (CE123 2017); each patient agreed to participate in the study and signed a written informed consent.
OCT-A images were taken using a commercially available swept-source instrument after pupil dilation. The device used was the swept-source DRI OCT/OCT-A Triton Plus (Topcon Medical Systems Europe, Milano, Italy). This instrument has a wavelength of 1050 nm and a scanning speed of 100,000 A-scans/second. Image processing relies on a motion contrast measure named OCT-A Ratio Analysis (OCTARA). OCT-A maps covering the central 3 mm × 3 mm macular area were acquired for each subject at each follow-up visit. All images were carefully reviewed to check automatic segmentation of the different plexuses. Poor quality images were excluded from the analysis, with the exception of motion artifacts presence.
Original OCT-A images were exported with a resolution of 320 × 320 pixels (9.4 μm lateral resolution).
The diagnosis of ME was made by means of fundus examination, performed by the ophthalmologist expert in retinal disorders (S.V.), and structural OCT, performed with the same instrument as OCT-A on the same day by a trained ophthalmologist (C.T.). On OCT, a 6-mm radial scan (consisting of 12 scans 15° apart) centered on the fovea was acquired.

Cyst Detection and Motion Artifacts Elimination Algorithm
As discussed in the Introduction section, discrimination of the cysts from surrounding tissue based only on the gray level values on OCT-A angiograms is not easily achievable, since they can be similar, in particular in cases where non-perfused areas are present. Some considerations could be made regarding the different morphology of the dark elements. Concerning the cysts, they appear as a group of contiguous black pixels of different and sometimes irregular shape, that can displace retinal vessels because of a mechanical effect on surrounding tissue. Non-vascularized areas, on the other hand, were described as dark regions as well, but with some internal signal noise (white pixels) and delimited by capillaries [13]. Motion artifacts appear as horizontal black bands.
However, even these considerations could not be enough to correctly differentiate dark elements on OCT-A angiograms. Therefore, in the present paper, a novel approach was developed and tested to detect intra-retinal cysts and motion artifacts using the structural information from the same slab used to image the blood flow in the SCP and DCP. Figure 1 shows the SCP and DCP flow and structural enface images obtained with the adopted acquisition system.  Figure 2 shows two enface structural SCP and DCP images of the same patient with macular edema. The former ( Figure 2A) represents an enface structural SCP image with cysts but without motion artifacts, while the latter ( Figure 2B) represents an enface structural DCP image with cysts and a motion artifact in the inferior part of the image, highlighted by a red box. Some of the biggest and most visible cysts in the two images are highlighted by blue boxes. In order to identify the cysts and to compensate for the potential presence of motion artifacts in enface flow OCT-A images, the authors developed a novel algorithm based on filters and morphological operations, which uses information of corresponding structural enface images of the SCP and DCP OCT-A slabs. In order to be used in the clinical practice, the algorithm should not be heavy from the computational point of view, allowing a fast analysis of the OCT-A images. Algorithm 1 shows the main steps of the proposed method. The algorithm has been developed in Matlab R2019a, MathWorks, Natick, MA, using the Image Processing Toolbox. The proposed algorithm starts filtering the image with a 2-D Gaussian filter kernel (line 1), characterized by a standard deviation of 0.5 and a dimension of 5 × 5. This filter has been chosen since it is typically used in OCT-A imaging where it has been demonstrated to be a computationally efficient solution to reduce the noise. Moreover, this filter is widely used in applications targeted at detecting the edges/contours of different objects [14][15][16]. In fact, the Gaussian filter has a low-pass response, which attenuates high frequency signal components. This step can be seen as a preprocessing phase needed to better extract the features from the images.
The filtered image is then binarized (line 2) in order to identify the areas related to the cysts and the motion artifacts, since, as previously mentioned, they are characterized by dark pixels. In this case, the algorithm binarizes the image on the basis of a global threshold, which has been chosen after evaluating the results of different experiments. In particular, the best results are achieved when the threshold is calculated with Otsu's method, which computes the threshold value by minimizing the intraclass variance of the thresholded black and white pixels. Appendix A shows an example of how a different threshold value impacts the final classification.
The next step concerns the elimination of isolated pixels, eventually due to noise. This task is performed by applying an image erosion followed by an image dilation with a suitable structuring element (lines 3-4). In this case, the structuring element has been chosen after several experiments, which indicated a square of size 2 × 2 as the best structuring element. The output produced by these phases is shown in Figure 3, considering as input the same images shown in Figure 2. By analyzing the outputs shown in Figure 3, it is possible to distinguish between two main cases. In the first case, when the input image does not present motion artifacts, the output of the first two phases is sufficient to correctly identify the cyst area ( Figure 3B). On the other hand, if the input image contains a motion artifact, the output does not highlight just the cysts, since the motion artifact also appears as a black area. To identify and remove these artifacts, the algorithm searches the horizontal long lines which characterize the superior and inferior edges of the motion artifact, employing the Canny filter (line 5) to enhance the detection quality [17]. This filter searches for local maxima in the image gradient, which is computed using a second derivative of the Gaussian filter. The authors chose this filter since it performs non-maximum suppression on the image gradient, in order to delete spurious edges. The remaining maximum values in the gradient images are then processed with the double threshold method [18]. Finally, the edges are tracked through the hysteresis method.
The obtained image is then elaborated through the Hough transform (line 6), which finds all the line-shaped edges. However, this does not mean that all those edges are related to a motion artifact. In fact, some cysts can have edges with shapes similar to a line, and can be identified by the Hough transform as lines. In order to avoid the misclassification of these edges, authors performed several experiments in order to identify suitable thresholds, to discriminate between the edges related to the motion artifacts and those related to the cysts. In particular, the characteristics that can discriminate between two kinds of edges are the slope and the length of the lines. Analyzing the dataset, authors noticed that motion artifacts are horizontal bands that occupy almost one third of the image. Therefore, we defined suitable thresholds for the line's slope and length. In particular, the images analysis showed that the shortest motion artifact extends for approximately 1 mm of length, while the longest one extends for the whole image length (3 mm). Therefore, authors chose to set the length threshold to 1 mm, which is one third of the image length.
Only the lines with the correct slope and lengths are considered as motion artifact edges (lines 7-11). An example of typical edges in a motion artifact is shown in Figure 4, where the lines obtained with the proposed method are highlighted in green. At this point, the algorithm checks if the previous step has found edges related to motion artifacts. If it has, the motion artifacts are eliminated from the image by the forcing to the white value of the pixel included between the edges. Otherwise, no modifications are applied to the image (lines [12][13][14][15][16].
The final step of the algorithm computes the total area of the cysts, by counting the number of black pixels and multiplying it by the spatial resolution of a single pixel.
Finally, the black and white images obtained by the proposed method can be used as masks for the enface flow images, in order to correctly evaluate microvascular parameters such as perfusion density (PD). The exclusion of these areas from the computation of PD is of crucial importance, since they can be erroneously identified as areas without vascularization, resulting in an underestimation of PD.
For the methodology validation, authors visualized the intermediate results of all the algorithm steps. These intermediate results have been also used to perform fine-tuning on the different parameters, whose values have been given in the previous section.
Medical doctors have validated the results in terms of cyst-delineation and motion artifactremoving. For all the analyzed images, the cysts' borders where correctly delineated. Moreover, all the motion artifacts were correctly identified and removed.
The considered dataset includes both images where the cysts are clearly visible and easy to delineate, and images where the cysts are big and with a complex geometry. The proposed algorithm has been validated also for images containing complex geometries.
The quality of the detection has also been quantitatively evaluated, by comparing the ground truth maps produced by the expert medical doctors with the results of the proposed method. Authors adopted different indexes to evaluate the detection. In particular, the Jaccard index has been adopted to measure how the detection performed by the proposed method is similar to the medical doctor's analysis. The index is defined by Equation (1): where is the ground truth produced by the medical doctor, while is the output of the algorithm. The cyst detection has also been evaluated in terms of Sensitivity, Specificity, Accuracy, Precision and F1 score, defined by Equations (2)-(6): where are the true positives, the false negatives, the false positives, and finally are the true negatives. In this case, a is a pixel, identified by both the medical doctor (MD) and the proposed method, as a cyst, while a is a pixel classified as not a cyst by the MD and the algorithm. On the other hand, a is a pixel classified as not a cyst by the MD but identified as a cyst by our method. Finally, a is a pixel identified as a cyst by the MD but classified as not a cyst by our algorithm.

Results
The proposed method has been tested on a wide dataset, consisting of 194 images acquired from 30 different patients with macular edema, including both images with and without motion artifacts (about 27%).
The values of sensitivity, specificity, accuracy and precision are reported in Table 1. The values shown in Table 1 clearly highlight the effectiveness of the proposed method, which is always capable of correctly detecting the cysts' margins excluding the motion artifacts.
The effectiveness of our algorithm is also shown by the Receiver Operating Characteristic (ROC) curve reported in Figure 5.  Figure 6 shows some images where the cysts' edges delineated by the proposed algorithm are highlighted in red, and in this way shows how the proposed method is capable of correctly delineating the cysts' borders. In the third image of the second row, a motion artifact is present. As highlighted by the red borders, the motion artifact is excluded from the cyst detection. The computational complexity of the proposed algorithm has been evaluated by measuring the processing times taken by the Matlab script. The test has been conducted on a PC with an Intel i7-6700 CPU, working at 3.40 GHz and equipped with 32 GB of RAM. Considering the worst case, i.e., when the motion artifacts compensation is performed, the processing time is always lower than 100 ms. This time is negligible if compared to the duration of a typical OCT-A acquisition, which lasts about 15 s. Moreover, if the patient is affected by low visual acuity, tremors or dementia, the exam duration is longer, and there is a higher probability of motion artifacts in the acquired image. However, this does not change the maximum time needed by the proposed algorithm. Therefore, the proposed algorithm is real-time compliant.

Discussion
In the present paper, a novel algorithm, able to successfully delineate cysts' contours and motion artifacts on enface structural images of both SCP and DCP slabs, is described. Experiments have been conducted considering different images, in some cases affected by motion artifacts. The cysts present in the images were of different sizes and shapes, in order to ensure that the proposed methodology produces correct results in different scenarios.
The instrument used in the present study can acquire images covering an area of 3 mm × 3 mm or of 6 mm × 6 mm. In both cases, the image has a size of 320 × 320 pixels. Therefore, considering an area of 3 mm × 3 mm ensures the acquisition of more details than capturing a 6 mm × 6 mm area. For this reason, authors tested the proposed method on images covering a 3 mm × 3 mm area. Moreover, a previous work [19] reported that the instrument used in this study is able to detect even early microvascular impairment. However, this algorithm can be easily applied to images of different sizes and obtained with different OCT-A instruments.
In the literature, different approaches have been proposed for cyst detection on both OCT and OCT-A images.
As for OCT, Wilkins et al. [20] proposed a method based on the cascade application of retinal layer segmentation, median filtering, signal-to-noise ratio balancing, bilateral filtering, thresholding, boundary tracing and the rejection of false positives. The authors claimed to correctly delineate cyst borders. However, the authors validated their methodology with images acquired from only 16 patients [20], while in the present work we consider a larger dataset, which includes 194 images from 30 different patients. Finally, the authors did not report any result about computational complexity or processing time. Another interesting work was published by Gonzàlez et al. [21]; in this paper, cyst detection was performed through watershed segmentation. In this case as well, the considered dataset included only 30 images [21]. Moreover, the computational complexity is not reported. A recent work by Gopinath et al. adopted convolutional neural networks to delineate the cyst margin on OCT images [22]. The work considered three different datasets, acquired from four different commercial devices. The datasets were divided into training and test sets, each one including 15 training and 15 testing volumes. The authors reported some limitations related to the detection of small cysts. In fact, the convolutional neural network is not capable of detecting small cysts. It is also important to consider that the use of a convolutional neural network requires a labelled dataset and long training times. Finally, the computational complexity of the method is not reported.
About all these works, it is important to highlight that they adopted OCT imaging, not OCT-A; therefore, a direct comparison with the proposed method cannot be performed.
As for OCT-A, De Carlo et al. [12] were the first to try to differentiate intra-retinal cysts from non-perfused areas in SCP and DCP OCT-A images using a Spectral Domain instrument. Based on their results, they concluded that intra-retinal cysts can be seen as black oblong areas, completely devoid of signal, whereas non-perfused areas were described as dark regions with some internal noise and surrounded by capillaries [12]. In fact, all the images with retinal cysts evaluated in the present study have the characteristics described by De Carlo et al. [12]. Therefore, the authors feel quite confident in excluding the presence of relevant ischemic areas in the macular region.
Kashani et al. [23] later described a new OCT-A feature called suspended scattering particles in motion (SSPiM), appearing as an extravascular signal of flow on OCT angiograms and thought to be related to the motion of particles within intra-retinal fluid, being considered a marker of cysts. Recently, Parravano et al. [24] compared the appearance of cysts and non-perfused areas in images obtained with two different OCT-A devices, a Spectral Domain device and a Swept Source device. In their study, the authors integrated data of OCT-A angiograms and corresponding B-scan OCT with flow, in order to differentiate non-perfused areas and cysts, and for the detection of SSPiM. While they confirmed that dark regions could correspond either to non-perfused areas or cysts with both instruments, they reported that both features could have some internal signal, and interestingly this internal signal (SSPiM) was more frequently associated with cysts than with non-perfused areas.
All the previously mentioned studies have as their main focus the identification of intra-retinal cysts and non-perfused areas based on clinical expertise, with the objective of finding specific qualitative characteristics that could help in their differentiation. In the present paper, the proposed algorithm for cyst detection has the advantage of defining, precisely and automatically, the borders of the cysts, making this method suitable for quantitative analyses.
To the best of our knowledge, this is the first work using enface structural SCP and DCP images to detect intra-retinal cysts and motion artifacts, building a sort of "map" to be used as a mask on enface flow corresponding images in order to remove these elements from the computation of perfusion parameters. In the past, a method aimed at compensating for signal attenuation in the choriocapillaris OCT-A slab, caused by defects of the retinal pigmented epithelium and Bruch's membrane, by using the corresponding enface structural images, was developed and validated by Zhang et al. [25]. However, this method does not take into account the presence of cysts and/or motion artifacts.

Conclusions
This paper presented a novel methodology for cyst borders detection, including an original motion artifacts compensation technique for OCT-A images. The method has been validated on a dataset consisting of 194 images acquired from 30 patients, larger than what is typically found in the literature. The algorithm is able to correctly identify the cysts' borders, eliminating the motion artifacts that could alter the results. Moreover, the results are produced in about 100 ms, which is a negligible time if compared to the duration of a typical OCT-A exam, even when considering healthy and collaborative patients.
To the best of the authors' knowledge, the use of enface structural images for cyst detection together with the elimination of motion artifacts, in order to avoid an erroneous cyst border delineation, has not been adopted before. Moreover, the proposed method does not need a labelled dataset, since it is not based on supervised learning techniques. It is also important that the effort to produce a labelled dataset to use as a training set is not negligible.
Future research will be focused on the integration of this method in more complex analysis, in order to exclude the area related to the cysts from vascularization or flow-voids computations. Moreover, further studies would be needed to evaluate an algorithm to distinguish between cysts and non-perfusion areas.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A
In this section, the authors give additional information on the global threshold effect on the final classification. Figure A1 shows the impact of three different thresholds on an enface structural image. Figure A1A shows the original enface structural image after the Gaussian filter. The result of the binarization with a threshold lower than the optimal one is shown in Figure A1B. It is clear that a low threshold has the effect of deleting from the binary image part of the cyst; therefore, the final classification of this image will lead to wrong margin detection. Figure A1C shows the binarized image when the optimal threshold is adopted. In this case, it is possible to observe how the cysts are present in this binary image. Moreover, in the upper and in the lower right corners there are some black pixels related to big blood vessels. Those pixels will be eliminated by the erosion and dilation steps of the algorithm. Finally, Figure A1D shows the effect of a threshold greater than the optimal one. It is possible to see that, in this case, a lot of pixels not belonging to the cysts are present in the image. To further show the impact of the choice of the global threshold on the final classification, Figure  A2 reports the effect of the threshold value on the total accuracy of the algorithm.