The Cirrus HD-OCT Model 4000 (Carl Zeiss Meditech) was used to acquire the OCT images with software version 5.2. OCT images were acquired from 16 patients with vitreoretinal disorders and evidence of intraretinal cysts, and three patients without intraretinal cysts. Images were acquired at the Kittner Eye Center, University of North Carolina at Chapel Hill, Chapel Hill, and were anonymized to comply with Health Insurance Portability and Accountability Act privacy standards. OCT image stacks comprised a 6 mm × 6 mm × 2 mm data cube with a voxel size of 15 μm × 47 μm × 7.4 μm in x × y × z, respectively. They were stored and analyzed in x—z (B-mode) frames of 405 × 270 pixels. We analyzed four full datasets (one CME and three control) which extended over 128 frames in y, and 15 partial datasets (all CME) which extended over 8—20 frames centered over the macula in y. These partial stacks were used because manual evaluation of the accuracy of the algorithm was time consuming; since intraretinal cysts appeared only in a distinct subset of the full set, small subsets allowed us to rapidly assess a larger number of patients.
In overview, our method involves the following steps in sequence: conversion to grayscale, retinal layer segmentation, median filtering, signal-to-noise ratio (SNR) balancing, bilateral filtering, thresholding, boundary tracing, and rejection of FPs. The entire method is written in MATLAB version R2010a, MathWorks, Inc. It is fully automated and runs as a single function, with the only user-defined input being the image stack files obtained directly from the Cirrus OCT. Each step is described sequentially in the following.
A. Color Mapping and Retinal Layer Segmentation
Initially, images obtained from the Cirrus OCT system are in a 24-bit color bitmap format, and contain a white segmentation line for the nerve fiber layer (NFL) and a black segmentation line for the retinal pigment epithelium (RPE) layer. We use these segmentation lines to define the upper and lower bounds, respectively, of the retina (retinal ROI) in which we segment the cystoid fluid.
First, to condition the images for analysis, we map the color bitmap to a grayscale image according to the National Television System Committee standard using the MATLAB function “rgb2gray.” While this function is not the true inverse of the proprietary color mapping used in the Cirrus OCT, it importantly maintains the relevant contrast between tissue and cystoid fluid regions (see ). This step allows one to implement this algorithm on other OCT imaging devices without the need for proprietary software. We note that software to directly obtain the gray level values and segmentation lines of data obtained from the Cirrus is available under a contractual agreement with Zeiss. Next, we identify the locations of the Cirrus NFL and RPE lines using the fact that they are each two rows thick with values of 255 and 0, respectively. An initial top-to-bottom search in the leftmost column is used to identify row positions for each line, and each adjacent column is, then, searched within the immediately neighboring rows. However, in the instances where NFL and RPE lines are noncontiguous, the algorithm resorts to interpolating the NFL and RPE layers by an intensity density method, where the average within a 5 × 5 pixel window is thresholded by empirically determined values of >35 and <22 for the white NFL curve and the black RPE curve, respectively. The highest row that satisfies these threshold conditions in each column is recorded, and each line is, then, interpolated by a fifth-order polynomial. Identification of these lines is, then, used to define our retinal ROI in each B-mode image (see ).
OCT image in after identification of the RPE and NFL segmentation lines (shown in red), which define the lower and upper bounds of the retinal ROI, respectively.
B. Median Filtering and Signal-to-Noise Balancing
To suppress shot noise, we, then, used median filtering (MATLAB function “medfilt2”) over 3 × 3 pixels in x × z. We, then, balance the apparent SNR of each retinal scan. This is performed because the SNR of OCT images is variable from patient to patient, and adjustment of the SNR ensures consistent segmentation of cystoid fluid. The apparent noise N in an image stack is taken as the mean pixel value within a 27 × 40 window in the upper left portion of the image. The signal S is taken as the mean pixel value within a 27 × 40 window located 54 pixels from the rightmost image side proceeding from the rows adjacent to the bottommost row of the NFL interpolated curve. The values for N and S are averaged across the stack in y. The image data are, then, SNR balanced using the equation If = (I0 – N)/(S – N), where I0 is the initial pixel value and If is the final pixel value, which is stored as a floating point value between 0 and 1 (see , top panel).
(Top panel) Median-filtered and SNR-balanced OCT image. (Bottom panel) Bilaterally filtered OCT image.
C. Bilateral Filtering
Bilateral filtering acts to preserve edges while smoothing image data by weighing neighboring pixels based both on distance and similarity in pixel intensity. However, computation of a bilateral filter in its Gaussian functional form is computationally expensive and impractical for OCT image stack analysis. Here, we employ a fast bilateral filtering method described in [22
] that extends the 2-D image to a 3-D space and strategically down-samples to speed up the filter without adversely influencing the quality of the results. The photometric spread and the geometric spread were, respectively, σp
= (intensity range/10) = (1/10) = 0.1 and σg
= (width/16) = (270/16) = 17 pixels. The computation time per B-mode image by a traditional bilateral filter (MATLAB function “bfilter2”) is ~4 s, while the computation time per image by the method in [22
] is only ~0.4 s. We note that this per-image processing time is competitive with CPU times reported for other speckle denoising methods [19
], with the caveat that an exact comparison can only be drawn using the same image data on the same processor. As shown in the bottom panel of , the bilateral filter is effective at denoising the speckle while maintaining crisp edges between cystoid fluid and retinal tissue.
D. Thresholding and Boundary Tracing
Potential cystoid ROIs were, then, defined by contiguous pixel regions within the retinal ROI that were below an empirical value of 31, as shown in the top panel of . We chose this threshold to be very sensitive but with low specificity, with the plan to reject FPs in the following step. To enable this next step, we traced the thresholded pixel boundaries using a Moore-neighbor tracing algorithm modified by Jacob’s stopping criteria [26
] in each 2-D B-mode image, as provided by the “bwboundaries” function in MATLAB. This defines a discrete number of contiguous regions (the cystoid ROIs) in each B-mode image.
Thresholded OCT images. (Top panel) Before cyst discrimination. (Bottom panel) After cyst discrimination.
E. Rejection of FPs
While the process described previously was tailored to catch as many cystoid ROIs as possible, we found that, in practice, it also identified a number of FP CME regions. In order to improve upon the specificity, we employed two criteria to reject FP ROIs. First, cystoid ROIs had to have a traced area of at least 7 pixels. As shown by comparing the top and bottom panels of , this tended to remove FPs within the outer plexiform layer (OPL) where the optical scattering signal was lower. Second, we found that true positives (TPs) had a pixel intensity distribution that was reasonably uniform, and therefore, we rejected regions with pixel values exhibiting a standard deviation greater than an empirically determined value of 45. This tended to reject FPs from blood vessels that have a shadowing artifact extending into the layer immediately below. However, we found that in stacks of low SNR this criterion also caused rejection of some TPs. For this reason, the pixel uniformity metric was assigned a switch. If the SNR was ≥22, the pixel uniformity metric was applied; if not, the data were processed without it.
displays the final cystoid ROIs overlayed on the original retinal image in .
Overlay of an original grayscale OCT image with the final cystoid ROIs displayed as white.