Optical coherence tomography (OCT) is becoming one of the most important detection modalities for fast and noninvasive assessment of ophthalmological diseases. Diabetic macular edema (DME) is one of the important reasons leads to blindness. Its pathological features are mainly manifested in the accumulation of fluid in the retina. An automated method is proposed to identify and quantify the volume of cystoid macular edema in Spectral Domain OCT (SD-OCT) images. In the first stage of preprocessing, we balance the apparent signal-to-noise of each retinal OCT image. Because the signal-to-noise of OCT images is variable from patient to patient, and balance of the signal-to-noise ensures consistent segmentation of cystoid fluid. Speckle noise is the main reason leads to quality degrading in OCT images. The denoising method should be efficient for the noise suppression, and the edge information can be preserved at the same time. Then we used the anisotropic diffusion filter to suppress shot noise. The intensity inhomogeneity in OCT images may lead to false detection in the further segmentation work. Then we used the gamma transformation to change the brightness, which eliminates the effect availably. In the second stage of segmentation, we solve the problem of segmentation effectively by the improved level set method and calculated the area of edema area, which provides quantitative analytic tools for clinical diagnosis and therapy. Finally, the proposed method was evaluated on 15 SD-OCT retinal images from DME adults. Leave-one-out evaluation resulted in a precision, sensitivity and dice similarity coefficient (DSC) of 81.12%, 86.90% and 80.05%, respectively.