###### 1 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%.