Volumetric scans of current SD-OCT devices can contain on the order of 50 million pixels. Due to this size and because quantitative measurements in these scans are often needed, automatic segmentation of these scans is required. In this paper, a fully automatic retinal layer segmentation algorithm is presented, based on pixel-classification. First, each pixel is augmented by intensity and gradient data from a local neighborhood, thereby producing a feature vector. These feature vectors are used as inputs for a support vector machine, which classifies each pixel as above or below each interface. Finally, a level set method regularizes the result, producing a smooth surface within the three-dimensional space. Volumetric scans of 10 healthy and 8 glaucomatous subjects were acquired with a Spectralis OCT. Each scan consisted of 193 B-scans, 512 A-lines per B-scan (5 times averaging) and 496 pixels per A-line. Two B-scans of each healthy subject were manually segmented and used to train the support vector machine. One B-scan of each glaucomatous subjects was manually segmented and used only for performance assessment of the algorithm. The root-mean-square errors for the normal eyes were 3.7, 15.4, 15.0 and 5.5 mu m for the vitreous/retinal nerve fiber layer (RNFL), RNFL/ganglion cell layer, inner plexiform layer/inner nuclear layer and retinal pigment epithelium/choroid interfaces, respectively, and 5.5, 11.5, 9.5 and 6.2 mu m for the glaucomatous eyes. Based on the segmentation, retinal and RNFL thickness maps and blood vessel masks were produced.