---
abstract: 'Optical coherence tomography (OCT) is a non-invasive imaging technique that can produce images of the eye at the microscopic level. OCT image segmentation to localise retinal layer boundaries is a fundamental procedure for diagnosing and monitoring the progression of retinal and optical nerve disorders. In this paper, we introduce a novel and accurate geodesic distance method (GDM) for OCT segmentation of both healthy and pathological images in either two- or three-dimensional spaces. The method uses a weighted geodesic distance by an exponential function, taking into account both horizontal and vertical intensity variations. The weighted geodesic distance is efficiently calculated from an Eikonal equation via the fast sweeping method. The segmentation is then realised by solving an ordinary differential equation with the geodesic distance. The results of the GDM are compared with manually segmented retinal layer boundaries/surfaces. Extensive experiments demonstrate that the proposed GDM is robust to complex retinal structures with large curvatures and irregularities and it outperforms the parametric active contour algorithm as well as the graph theoretic based approaches for delineating the retinal layers in both healthy and pathological images.'
author:
- |
    Jinming Duan$^*$, Christopher Tench$^\dagger$, Irene Gottlob$^\ddagger$, Frank Proudlock$^\ddagger$, Li Bai$^*$\
    $^*$School of Computer Science, University of Nottingham, UK\
    $^\dagger$School of Medicine, University of Nottingham, UK\
    $^\ddagger$Ophthalmology Department, University of Leicester, UK
bibliography:
- 'FinalVersion.bib'
title: Automated Segmentation of Retinal Layers from Optical Coherent Tomography Images Using Geodesic Distance
---

**Key words**: optical coherence tomography segmentation; geodesic distance; Eikonal equation; partial differential equation; ordinary differential equation; fast sweeping

**Introduction** {#Introduction}
================

Optical coherence tomography (OCT) is a powerful imaging modality used to image biological tissues to obtain structural and molecular information @huang1991optical. By using the low coherence interferometry, OCT can provide high-resolution cross-sectional images from backscattering profiles of biological samples. Over the past two decades, OCT has become a well-established imaging modality and widely used by ophthalmologists for diagnosis of retinal and optical nerve diseases. One of the OCT imaging biomarkers for retinal and optical nerve disease diagnosis is the thickness of the retinal layers. Automated OCT image segmentation is therefore necessary to delineate the retinal boundaries.

Since the intensity patterns in OCT images are the result of light absorption and scattering in retinal tissues, OCT images usually contain a significant amount of speckle noise and inhomogeneity, which reduces the image quality and poses challenges to automated segmentation to identify retinal layer boundaries and other specific retinal features. Retinal layer discontinuities due to shadows cast by the retinal blood vessels, irregular retinal structures caused by pathologies, motion artefacts and sub-optimal imaging conditions also complicate the OCT images and cause inaccuracy or failure of automated segmentation algorithms.

Over the past two decades a number of automatic and semi-automatic OCT segmentation approaches have been proposed. These approaches can be roughly categorised into three families: A-scan based methods, B-scan based methods and volume based methods, as illustrated in Figure \[fig:ABV\]. A-scan based methods @hee1995optical [@koozekanani2001retinal; @ishikawa2002detecting; @ishikawa2005macular; @shahidi2005quantitative; @fernandez2005automated; @mayer2008automatic] detect intensity peak or valley points on the boundaries in each A-scan profile and then form a smooth and continuous boundary by connecting the detected points using model fitting techniques. These methods can be inefficiency and lack of accuracy. Common approaches for segmenting two-dimensional (2D) B-scans include active contour methods @fernandez2005delineating [@mujat2005retinal; @mishra2009intra; @yazdanpanah2009intra; @ghorbel2011automated; @rossant2015parallel], shortest-path based graph search @chiu2010automatic [@yang2010automated] and statistical shape models @kajic2010robust [@kajic2012automated; @pilch2012automated] (i.e. active shape and appearance models @cootes1995active [@cootes2001active]). B-scans methods outperform A-scan methods in general. However, they are prone to the intrinsic speckle noise in OCT images and more likely to fail in detection of pathological retinal structures. Three-dimensional (3D) scan of the retina is now widely used in commercial OCT devices. Existing volume based segmentation methods mainly use 3D graph based methods @haeker2006segmentation [@garvin2008intraretinal; @garvin2009automated; @quellec2010three; @antony2012incorporation; @dufour2013graph; @kafieh2013intra; @tian2015real; @tian2016performance] and pattern recognition @vermeer2010automated [@vermeer2011automated; @fuller2007segmentation; @szkulmowski2007analysis; @lang2013retinal]. Benefiting from contextual information represented in the analysis graph, graph based methods provide optimal solutions and ideal for volumetric data processing. However, the computation can be very complex and slow. Pattern recognition methods normally require training data manually segmented by experts in order to learn a feasible model for classification. These approaches also suffer in accuracy and efficiency. Segmentation of retinal layers in OCT images thereby remains a challenging problem.

In this paper, we propose an algorithm for retinal layer segmentation based on a novel geodesic distance weighted by an exponential function. As opposed to using a single horizontal gradient as in other works @chiu2010automatic [@tian2015real; @tian2016performance], the exponential function employed in our method integrates both horizontal and vertical gradient information and can thus account for variations in the both directions. The function plays the role of enhancing the foveal depression regions and highlighting weak and low contrast boundaries. As a result, the proposed geodesic distance method (GDM) is able to segment complex retinal structures with large curvatures and other irregularities caused by pathologies. We compute the weighted geodesic distance via an Eikonal equation using the fast sweeping method @zhao2005fast [@tsai2003fast; @duan2015surface]. A retinal layer boundary can then be detected based on the calculated geodesic distance by solving an ordinary differential equation via a time-dependent gradient descent equation. A local search region is identified based on the detected boundary to delineate all the nine retinal layer boundaries and overcome the local minima problem of the GDM. We evaluate the proposed GDM through extensive numerical experiments and compare it with state-of-the-art OCT segmentation approaches on both healthy and pathological images.

In the following sections, we shall first review the state-of-the-art methods that are to be compared with the proposed GDM, such as parallel double snakes @rossant2015parallel, Chiu's graph search @chiu2010automatic, Dufour's method @dufour2013graph, and OCTRIMA3D @tian2015real [@tian2016performance]. This will be followed by the details of the proposed GDM, ground-truth validation, numerical experimental results, and comparison of the GDM with the state-of-the-art methods.

**Literature Review** {#reviewedMethod}
=====================

In this section, we will provide an overview of the state-of-the-art methods (i.e. parallel double snakes @rossant2015parallel, Chiu's method @chiu2010automatic, OCTRIMA3D @tian2015real [@tian2016performance], Dufour's method @dufour2013graph) that will be compared with our proposed GDM in Section \[GDM\]. For a complete review on the subject, we refer the reader to @debuc2011review. Among the four methods reviewed, the first two can only segment B-scans, while the latter two are able to extract retinal surfaces from volumetric OCT data. We note that the term 'surface' refers to a set of voxels that fall on the interface between two adjacent retinal layer structures. The retinal layer boundaries to be delineated are shown in Figure \[fig:OCTBoundary\].

**Parallel double snakes (PDS)**: Rossant et al. @rossant2015parallel detected the pathological (retinitis pigmentosa) cellular boundaries in B-scan images by minimising an energy functional that includes two parallel active parametric contours. Their proposed PDS model consists of a centreline $C(s)=(x(s),y(s))$ parametrised by $s$ and two parallel curves $C_1(s)=C(s)+b(s)n(s)$ and $C_2(s)=C(s)-b(s)n(s)$ with $b(s)$ being a spatially varying half-thickness and $n(s)=(n_x(s),n_y(s))$ the normal vector to the the centreline $C(s)$. Specifically, their PDS model is defined as $$E(C,{C_1},{C_2},b) = {E_{Image}}({C_1}) + {E_{Image}}({C_2}) + {E_{Int}}(C) + R\left( {{C_1},{C_2},b} \right)
\label{eq:PDS}$$ where the image energy ${E_{Image}}({C_1}) =- \int_0^1 {{{\left| {\nabla I({C_1})} \right|}^2}ds}$ ($\nabla$ is the image gradient operator) attracts the parametric curve $C_1$ towards one of retinal borders of the input B-scan $I$, whilst ${E_{Image}}({C_2})$ handles curve $C_2$ which is parallel to $C_1$. The internal energy ${E_{Int}}(C)=\frac{\alpha }{2}\int_0^1 {{{\left| {{C_s}\left( s \right)} \right|}^2}ds}  + \frac{\beta }{2}\int_0^1 {{{\left| {{C_{ss}}\left( s \right)} \right|}^2}ds}$ imposes both first and second order smooth regularities on the central curve $C$, with $\alpha$ and $\beta$ respectively controlling the tension and rigidity of this curve. $R\left( {{C_1},{C_2},b} \right)=\frac{\varphi }{2}\int_0^1 {{{\left| {b'\left( C \right)} \right|}^2}ds}$ is a parallelism constraint imposed on $C_1$ and $C_2$. Nine retinal borders have been delineated by the method, i.e., ILM, RNFL$_o$, IPL-INL, INL-OPL, OPL-ONL, ONL-IS, IS-OS, OS-RPE and RPE-CH.

  Notation                    Name of retinal boundary/surface                    Abbreviation
  ---------- ------------------------------------------------------------------- --------------
  $B_1$                          internal limiting membrane                           ILM
  $B_2$                outer boundary of the retinal nerve fibre layer              RNFL$_o$
  $B_3$                   inner plexiform layer-inner nuclear layer                 IPL-INL
  $B_4$                   inner nuclear layer-outer plexiform layer                 INL-OPL
  $B_5$                   outer plexiform layer-outer nuclear layer                 OPL-ONL
  $B_6$             outer nuclear layer-inner segments of photoreceptors             ONL-IS
  $B_7$       inner segments of photoreceptors-outer segments of photoreceptors      IS-OS
  $B_8$        outer segments of of photoreceptors-retinal pigment epithelium        OS-RPE
  $B_9$                      retinal pigment epithelium-choroid                      RPE-CH

  : Notations for nine retinal boundaries/surfaces, their corresponding names and abbreviations

\[tb:OCTBoundary\]

**Chiu's method**: Chiu et al. @chiu2010automatic modelled the boundary detection problem in OCT retinal B-scan as determining the shortest-path that connects two endpoints in a graph $G=(V,E)$, where $V$ is a set of nodes and $E$ is a set of undirected weights assigned to each pair of two nodes in the graph. Node $V$ corresponds to each pixel in the B-scan image, whilst weight $E$ is calculated from the intensity gradient of the image in its vertical direction. Each node is connected with its eight nearest neighbours and all other node pairs are disconnected, resulting in a sparse adjacency matrix of graph weights of vertical intensity variation. For example, an $M \times N$ sized image has an $MN \times MN$ sized adjacency matrix with $8MN$ non-zero filled entries. Mathematically, the weights between two nodes used in their method are calculated based on the pure vertical gradient value, defined as $$w\left( {a,b} \right) = \left\{ \begin{array}{ll}
2 - \left( {g_a + g_b} \right) + {w_{\min }}&\text{if}\;\left| {a - b} \right| \le \sqrt 2 \\
0&{\text{otherwise}}
\end{array} \right.
\label{eq:chiu}$$ where $g$ is the vertical gradient of a B-scan image; $a$ and $b$ denote receptively two separate nodes in $V$ and $w_{min}$ is a small positive value added to stabilise the system. The most prominent boundary is then detected as the minimum weighed path from the first to the last vertex in $V$ using Dijkstra's Algorithm. A similar region refinement technique to Section \[Detect9border\] was used to detect seven retinal boundaries, i.e., ILM, RNFL$_o$, IPL-INL, INL-OPL, OPL-ONL, IS-OS and RPE-CH.

**Dufour's method**: Dufour et al. @dufour2013graph proposed a modification of optimal graph search approach @song2010simultaneous to segment retinal surfaces in OCT volume data. By using soft constraints and adding prior knowledge learned from a model, they improve the accuracy and robustness of the original framework. Specifically, their Markov random field based model is given by $$\nonumber
E\left( S \right) = \sum\limits_{i = 1}^n {\left( {{E_{boundary}}\left( {{S_i}} \right) + {E_{smooth}}\left( {{S_i}} \right)} \right)}  + \sum\limits_{i = 1}^{n - 1} {\sum\limits_{j = i + 1}^n {{E_{{\mathop{ int}} er}}\left( {{S_i},{S_j}} \right)} }$$ where $S$ is a set of surfaces $S_1$ to $S_n$. The external boundary energy ${{E_{boundary}}\left( {{S_i}} \right)}$ is computed from the input 3D image data. The surface smoothness energy ${{E_{smooth}}\left( {{S_i}} \right)}$ guarantees the connectivity of a surface in 3D and regularises the surface. The interaction energy ${{E_{{\mathop{\rm int}} er}}\left( {{S_i},{S_j}} \right)}$ integrates soft constraints that can regularise the distances between two simultaneously segmented surfaces. This model is then built from training datasets consisting of fovea-centered OCT slice stacks. Their algorithm is capable to segment six retinal surfaces ($n=6$ in above formulation) in both healthy and macular edema subjects, i.e., ILM, RNFL$_o$, IPL-INL, OPL-ONL, IS-OS and RPE-CH.

**OCTRIMA3D**: Tian et al. @tian2015real [@tian2016performance] proposed a real-time automatic segmentation of OCT volume data. The segmentation was done frame-by-frame in each 2D B-Scan by considering the spatial dependency between each two adjacent frames. Their work is based on Chiu's graph search framework @chiu2010automatic for B-Scan OCT images. However, in addition to Chiu's work they introduce the inter-frame flattening to reduce the curvature in the fovea region and thus the accuracy of their algorithm has been improved. Moreover, they apply inter-frame or intra-frame information to limit the search region in current or adjacent frame so that the computational speed of their algorithm can be increased. Furthermore, the biasing and masking techniques are developed so as to better attain retinal boundaries within the same search region. A totally eight retinal surfaces, i.e., ILM, RNFL$_o$, IPL-INL, INL-OPL, OPL-ONL, IS-OS, OS-RPE and RPE-CH, can be delineated by the method. To sum up, Table \[tb:Checkmark\] reports the retinal boundaries/surfaces segmented by the four methods as well as our GDM proposed in the next section.

\[htbp\]

\[tb:Checkmark\]

**The Proposed Geodesic Distance Method (GDM)** {#GDM}
===============================================

In this section, we propose a novel framework using the geodesic distance to detect from OCT images nine retinal layer boundaries defined in Figure \[fig:OCTBoundary\] and Table \[tb:OCTBoundary\]. As the proposed methodology applies equally to both 2D and 3D segmentation, we will illustrate the approach for 2D segmentation here, as the steps would be the same for 3D segmentation. Numerical implementation of the approach is given in Appendix.

Geodesic distance
-----------------

We use geodesic distance to identify the pixels on the boundaries of retinal layers in OCT images. The geodesic distance $d$ is the smallest integral of a weight function $W$ over all possible paths from two endpoints (i.e. $s_1$ and $s_2$). The weight function determines how the path goes from $s_1$ to $s_2$. Small weight at one point indicates that the path has high possibility of passing that point. Specifically, the weighted geodesic distance between two pixels/endpoints $s_1$ and $s_2$ is given as $$\label{eq:GeodesicEq}
D\left( {{s_1},{s_2}} \right) = {\min _C}\int_0^1 {W^{-1}\left( {C\left( s \right)} \right)ds}$$ where $C\left( s \right)$ is the set of all the paths that link $s_1$ to $s_2$, and the path length is normalised and the start and end locations are $C(0)=s_1$ and $C(1)=s_2$, respectively. The infinitesimal contour length $ds$ is weighted by a non-negative function $W\left( {C\left( s \right)} \right)$. This minimisation problem can be interpreted as finding a geodesic curve (i.e. a path with the smallest weighted length) in a Riemannian space. In geometrical optics, it has proven that the solution of (\[eq:GeodesicEq\]) satisfies the Eikonal equation (\[eq:eikonalEq\]).

The retinal layers of OCT images are normally near horizontal. The gradient in the vertical direction thus can be considered as a good candidate for computing weight $W$ in (\[eq:GeodesicEq\]). For instance, each of the two prominent boundaries, e.g. ILM ($B_1$) and IS-OS ($B_7$) in Figure \[fig:gradinetMaps\] (a) and (e), is at the border of a dark layer above a bright layer. As a result, pixels in the region around the two boundaries will have high gradient values, as shown in Figure \[fig:gradinetMaps\] (b) and (f). As the retinal layers at each side of the boundary are either transiting from dark to bright or bright to dark, the non-negative weight function $W$ in this paper is defined based on intensity variation as follows $$\label{eq:weights}
W\left( x \right) = \left\{ \begin{array}{ll}
1 - exp\left(-\lambda \left( {1 - n\left( {{\nabla _x}I} \right)} \right)n\left( {\left| {{\nabla _y}I} \right|} \right)\right)&\text{dark-to-bright}\\
exp\left(-\lambda\left( {1 - n\left( {{\nabla _x}I} \right)} \right)n\left( {\left| {{\nabla _y}I} \right|} \right)\right)& \text{bright-to-dark}
\end{array} \right.$$ where $I$ is an input OCT image; $n\left( \cdot  \right)$ is a linear stretch operator used to normalise values to between 0 and 1; $exp$ is the exponential function and $\lambda$ is a user-define parameter, together they enhance the foveal depression regions and highlight the weak retinal boundaries @duan2016edgeweighted; and $\nabla_x$ and $\nabla_y$ are the first-order gradient operator along x (vertical) and y (horizontal) direction, respectively. The two gradient operators are discretised using a central finite difference scheme under the Neumann boundary condition. (\[eq:weights\]) also includes the positive horizontal gradient information $n\left( {\left| {{\nabla _y}I} \right|} \right)$, without which only vertical direction is accounted for and it is thus only applicable to flat retinal boundaries. Consequently, our proposed method is robust against curved features (e.g. the central region of the fovea) as well as other irregularities (e.g. bumps or large variations of boundary locations) caused by pathologies. In other words, the proposed method with the weight $W$ defined in (\[eq:weights\]) can deal with both normal and pathological images, as illustrated in Figure \[fig:gradinetMaps\] as well as in the experimental section.

\

Selection of endpoints $s_1$ and $s_2$
--------------------------------------

For fully automated segmentation, it is essential to find a way to initialise the two endpoints $s_1$ and $s_2$ automatically. Since the retinal boundaries in the OCT images used in this paper run across the entire width of the image, we add an additional column on each side to the gradient map computed from (\[eq:weights\]). As the the minimal weighted path is sought after, a weight $W_{max}$ larger than any of the non-negative weights calculated from (\[eq:weights\]) is therefore assigned to each of the newly added vertical columns (note that we use $W^{-1}$ for the geodesic distance \[eq:GeodesicEq\], the minimal weighted path thereby prefers large weights). This forces the path traversal in the same direction as the newly added vertical columns with maximal weights, and also allows the start and end points to be arbitrarily assigned in the two columns. Once the retinal layer boundary is detected, the two additional columns can be removed. Figure \[fig:endPoints\] shows two examples of endpoint initialisation.

\

**Eikonal equation and minimal weighted path** {#EikonalEq}
----------------------------------------------

The solution of (\[eq:GeodesicEq\]) can be obtained by solving the Eikonal equation after the endpoints are determined. Specifically, over a continuous domain, the distance map $D(x)$ to the seed start point $s_1$ is the unique solution of the following Eikonal equation in the viscosity sense $$\label{eq:eikonalEq}
\left| {\nabla D\left( x \right)} \right| = W^{-1}\left( x \right),\;\;\forall x \notin s_1$$ with $D\left( s_1 \right) = 0$. The equation is a first order partial differential equation and its solution can be found via the classical fast marching algorithm @sethian1996fast [@sethian1999level] using an upwind finite difference approximation with the computational complexity $O(MNlog(MN))$ (MN is the total number of grid points). Recently, the fast sweeping algorithm @zhao2005fast [@tsai2003fast] has been proposed. This technique is based on a pre-defined sweep strategy, replacing the heap priority queue to find the next point to process, and thereby has the linear complexity of $O(MN)$. In this paper, we apply fast sweep for (\[eq:eikonalEq\]) and its detailed 3D implementation has been given in Appendix. Figure \[fig:distMap\] shows two distance maps calculated using the dark-to-bright weight defined in (\[eq:weights\]) and two different start points as shown in the examples in Figure \[fig:endPoints\].

Once the geodesic distance map to the start point $s_1$ has been computed, the minimal weighted path (geodesic curve) between point $s_1$ and $s_2$ can be extracted from the following ordinary differential equation through the time-dependent gradient descent $$\gamma '\left( t \right) =  - {\eta _t}\nabla D\left( {\gamma \left( t \right)} \right),\;\; \gamma \left( 0 \right) = {s_2}$$ where $\eta _t>0$ controls the parametrisation speed of the resulting curve. To obtain unit speed parametrisation, we use ${\eta _t} = \left| {\nabla D\left( {\gamma \left( t \right)} \right)} \right|_\varepsilon ^{ - 1}$. Since distance map $D$ is nonsmooth at point $s_1$, a small positive constant $\varepsilon$ is added to avoid dividing by zero. Note the point $s_1$ is guaranteed to be found from this ordinary differential equation because the distance field is monotonically increasing from $s_1$ to $s_2$, which can be observed in Figure \[fig:distMap\]. This technique can achieve sub-pixel accuracy for the geodesic path even if the grid is discrete.

\

The geodesic curve is then numerically computed using a discretised gradient descent, which defines a discrete curve $\gamma^{k}$ using $$\label{eq:GradientDescentFlow}
{\gamma ^{k + 1}} = {\gamma ^k} - \tau G\left( {{\gamma ^k}} \right)$$ where $\gamma^{k}$ is a discrete approximation of $\gamma(t)$ at time $t=k\tau$, and the time step size $\tau>0$ should be small enough. $G\left( x \right)$ is the normalised gradient $ {{\nabla D\left( {\gamma \left( t \right)} \right)} \mathord{\left/
 {\vphantom {{\nabla D\left( {\gamma \left( t \right)} \right)} {\left| {\nabla D\left( {\gamma \left( t \right)} \right)} \right|_\varepsilon ^{ - 1}}}} \right.
 \kern-\nulldelimiterspace} {\left| {\nabla D\left( {\gamma \left( t \right)} \right)} \right|_\varepsilon ^{ - 1}}}$ parametrised by the arc length. Once $\gamma^{k+1}$ reaches $s_1$, one of the retinal boundaries can be found. The following concludes the proposed geodesic distance algorithm for extracting one retinal boarder in OCT images.

  <span>**Algorithm 1**</span>: the proposed GDM for one retinal boundary detection
  ----------------------------------------------------------------------------------------------------------
  1: Input OCT data $I$ (i.e. B-scan or volume)
  2: calculate dark-to-bright or bright-to-dark weight $W$ using (\[eq:weights\])
  3: pad two new columns to the weight and assign large values to them
  4: select two endpoints $s_1$ and $s_2$ on the two newly padded columns
  5: calculate distance map $D$ in (\[eq:eikonalEq\]) using fast sweeping algorithm
  6: find one retinal layer boundary $\gamma$ using the gradient descent flow (\[eq:GradientDescentFlow\])
  7: remove the additional columns in the edge detection result

**Detection of nine retinal layer boundaries** {#Detect9border}
----------------------------------------------

We have introduced how the proposed geodesic distance algorithm (\[eq:GeodesicEq\]) can find the minimal weighted path across the whole width of the OCT image for one retinal layer boundary. In this section, we shall describe the implementation details of the proposed approach to delineate nine retinal layer boundaries as shown in Figure \[fig:OCTBoundary\] and Table \[tb:OCTBoundary\]. Since the proposed model (\[eq:GeodesicEq\]) is not convex, its solution can easily get stuck in local optima. For example, Figure \[fig:gradinetMaps\] (c) and (g) have high gradient values in the region around both the ILM and IS-OS boundaries. However, in Figure \[fig:gradinetMaps\] (d) the algorithm detected the ILM boundary while in Figure \[fig:gradinetMaps\] (h) it detected the IS-OS. In order to eliminate such uncertainty, we dynamically define the search region based on the detected boundaries. The following section describes the proposed method in detail.

### **Detection of the IS-OS boundary**

The intensity variation between two layers divided by the IS-OS ($B_7$) border are normally the most prominent in OCT B-scans. However, due to the fact that OCT images are always corrupted by speckle noise as a result of light absorption and scattering in the retinal tissue, it is not always the case. For example, the intensity variation around the IML ($B_1$) border sometimes can be more obvious than that around the IS-OS, as shown in the gradient image Figure \[fig:gradinetMaps\] (c). To make sure the segmentation of the IS-OS boundary we first enhance the IS-OS via a simple local adaptive thresholding approach[^1], which is given as follows $$\label{eq:threshold}
p = \left\{ \begin{array}{ll}
0 &ls\left( {I,ws} \right)-I > C\\
1 &\text{otherwise}
\end{array} \right.$$ where $I$ is the input OCT image, and $ls\left( {p,ws} \right)$ means that $I$ is convolved with a suitable operator, i.e. the mean or median filter. $ws$ is the window size of the filter and $C$ a user-defined threshold value. In the paper, we use the mean filter with the window size $ws=100$ and set $C=0.01$. The enhanced image can be then obtained by multiplying the original image $I$ with $p$. The first two images in Figure \[fig:preSegImg\] illustrates that the contrast of the IS-OS boarder has been enhanced and the most obvious intensity variation now takes place around the IS-OS boundary. The IS-OS boundary then is detected on the dark-to-bright gradient image. Consequently, the delineated line is guaranteed to pass the IS-OS in both cases, as shown in the last two images in Figure \[fig:preSegImg\].

### **Detection of the RPE-CH, OS-RPE and ONL-IS boundaries**

Once the IS-OS ($B_7$) is segmented, it can be used as a reference to limit the search region for segmenting the RPE-CH ($B_9$), OS-RPE ($B_8$) and ONL-IS ($B_6$) boundaries. RPE-CH and OS-RPE are below the IS-OS and they are delineated in the following way: the RPE-CH can be extracted by applying the geodesic distance algorithm with the bright-to-dark gradient weights (\[eq:weights\]) obtained from the region pixels below the detected IS-OS (i.e. the bright-to-dark gradient weights are set to zeros above the IS-OS); the OS-RPE is then delineated on the bright-to-dark gradient map in the region between the detected IS-OS and RPE-CH (i.e. the bright-to-dark gradient weights are set to zeros outside of the region between the IS-OS and RPE-CH). The dark-to-bright ONL-IS is above the IS-OS. The search region can be constructed between the IS-OS boundary and a parallel line above it with a diameter of 15 pixels. The dark-to-bright gradient weights outside of the region are then set to zeros. Hence, the only boundary in the search region of the dark-to-bright gradient image is the ONL-IS which can be extracted.

### **Detection of the ILM and INL-OPL boundaries**

Both the ILM ($B_1$) and INL-OPL ($B_4$) are at the border of a darker layer above a bright layer. The intensity variation around the IML boundary is much more prominent and thus the IML is segmented first. The detected ONL-IS ($B_6$) edge is taken as a reference and the dark-to-bright gradient weights below the ONL-IS is set to zeros. The ILM can then be obtained via the proposed method. The INL-OPL can then be easily detected on the dark-to-bright gradient map by simply limiting the search region between the ILM and ONL-IS (i.e. the dark-to-bright gradient values are set to zeros outside of the region between the ILM and ONL-IS).

### **Detection of the OPL-ONL, IPL-INL and RNFL$_o$ boundaries**

The OPL-ONL ($B_5$), IPL-INL ($B_3$) and RNFL$_o$ ($B_2$) demonstrate a bright layer above a darker layer and thus can be detected on the bight-to-dark gradient map defined in (\[eq:weights\]). The segmented INL-OPL ($B_4$) and ONL-IS ($B_6$) are taken as two reference boundaries, and the OPL-ONL edge can be found by limiting the search region between the INL-OPL and ONL-IS. The search region for the IPL-INL can be then constructed between the INL-OPL boundary and a parallel line above it with a diameter of 20 pixels. The IPL-INL can be located on a bright-to-dark gradient map which is set to zeros outside of the search region constructed. Finally, the RNFL$_o$ ($B_2$) can be found in the search region between the two reference boundaries IPL-INL and IML ($B_1$). However, because the IPL-INL and IML boundaries are very close to each other in the central region of the fovea, the search region for the RNFL$_o$ are sometimes missing around the fovea region. This leads to segmentation errors of the RNFL$_o$, as shown in Figure \[fig:SegAllLayers\] (a). These errors however can be avoided by simply removing the spurious points detected on the RNFL$_o$ in the region above the IML, as shown in Figure \[fig:SegAllLayers\] (b). The proposed methods for segmenting nine retinal layer boundaries can be summarised in the flow chart as shown in Figure \[fig:flowChart\].

\

\

**Experiment Setup**
====================

To evaluate the performance of the proposed GDM qualitatively and quantitatively, numerical experiments are conducted to compare it with the state-of-the-art approaches reviewed in Section \[reviewedMethod\] on both healthy and pathological OCT retinal images. As the GDM is able to segment both 2D and 3D OCT images, we perform numerical experiments on both B-scan and volumetric OCT data. An anisotropic total variation @goldstein2009split is used to reduce noise prior to determining the layers boundaries/surfaces for all segmentation methods. In the following, we introduce the detailed procedure of OCT data acquisition, the evaluation metrics used to quantify the segmentation results, the final numerical results, and the computational complexity of different methods.

Clinical Data
-------------

30 Spectralis SDOCT (ENVISU C class 2300, Bioptigen, axial resolution = 3.3µm, scan depth = 3.4mm, 32, 000 A-scans per second) B-scans from 15 healthy adults (mean age = 39.8 years, SD = 8.6 years; 7 male, 8 female) were used for the research. All the data was collected after informed consent was obtained and the study adhered to the tenets of the Declaration of Helsinki and Ethics Committee approval was granted.

**2D B-scan data**: The normal vivo B-scan OCT data was imaged from the left and right eye of 15 healthy adults using a spectral domain OCT device with a chin rest to stabilise the head. The B-scan located at the foveal centre was identified from the lowest point in the foveal pit where the cone outer segments were elongated (indicating cone specialisation). To reduce the speckle noise and enhance the image contrast, every B-scan was the average of aligned images scanned at the same position. In addition to the 30 OCT images from the healthy subjects, another 20 B-scans from subjects with pathologies are also used to compare the proposed GDM with other approaches in pathological cases. These B-scans are from an eye with dry age-related macular degeneration (drye-AMD), which is available from Dufour's software package's website[^2]. The accuracy of segmentation results obtained by the three automated 2D methods (i.e. PDS, Chiu's method and GDM) over these healthy and pathological B-scans is evaluated using the ground truth datasets, which were manually delineated with extreme carefulness by one observer.

**3D Volume data**: 10 Spectralis SD-OCT (Heidelberg Engineering GmbH, Heidelberg, Germany) volume data sets from 10 healthy adult subjects are used in this study. Each volume contains 10 B-scans, and the OCT A-scans outside the 6mm $\times$ 6mm (lateral $\times$ azimuth) area and centred at the fovea were cropped to remove low signal regions. All volumetric data can be downloaded from @tian2015real, where also contains the results of the **OCTRMA3D**, and the manual labellings from two graders. In this study we choose the manual labelling of grader 1 as the 3D ground truth.

Evaluation Metrics
------------------

Performance metrics are defined to demonstrate the effectiveness of the proposed method and compare it with the existing methods. Three commonly used measures of success for OCT boundary detection are signed error (SE), absolute error (AE) and Hausdorff distance (HD). Among them, SE indicates the bias and variability of the detection results. AE is the absolute difference between the automatic detection results and ground truth, while HD measures the distance between the farthest point of a set to the nearest point of the other and vice versa. Specifically, these metrics are denoted as $$\begin{array}{c}
{\rm{SE}}\left( {{B_i},{{\tilde B}_i}} \right) = \frac{1}{n}\sum\limits_{j = 1}^n {\left( {{B_{ij}} - {{\tilde B}_{ij}}} \right)} \\
{\rm{AE}}\left( {{B_i},{{\tilde B}_i}} \right) = \frac{1}{n}\sum\limits_{j = 1}^n {\left( {\left| {{B_{ij}} - {{\tilde B}_{ij}}} \right|} \right)} \\
{\rm{HD}}\left( {{B_i},{{\tilde B}_i}} \right) = \max \left( {\mathop {\max }\limits_{x \in {B_i}} \left\{ {\mathop {\min }\limits_{y \in {{\tilde B}_i}} \left\| {x - y} \right\|} \right\},\mathop {\max }\limits_{x \in {{\tilde B}_i}} \left\{ {\mathop {\min }\limits_{y \in {B_i}} \left\| {x - y} \right\|} \right\}} \right)
\end{array}$$ where $B_i$ and ${\tilde B}_i$ are respectively the detected boundaries and ground truth boundaries (i.e. manual labellings). $n$ is the number of pixels/volexs that fall on the retinal boundary/surface. Statistically, when the SE value is close to zero, the difference between $B_i$ and ${\tilde B}_i$ is small. In this case, the detection result is less bias. The measurements of AE and HD (varies from 0 to $\infty $ theoretically) signify the difference between two boundaries, e.g., 0 indicates that both retinal structures share exactly the same boundaries, and larger AE and HD values mean larger distances between the measured boundaries. We also monitor the overall SE (OSE), AE (OAE) and HD (OHD) during all the experiments. They are defined as $$\begin{aligned}
\rm{OSE} &= \frac{1}{s}\sum\limits_{i = 1}^s {{\rm{SE}}\left( {{B_i},{{\tilde B}_i}} \right)} \\
\rm{OAE} &= \frac{1}{s}\sum\limits_{i = 1}^s {{\rm{AE}}\left( {{B_i},{{\tilde B}_i}} \right)} \\
\rm{OHD} &= \frac{1}{s}\sum\limits_{i = 1}^s {{\rm{HD}}\left( {{B_i},{{\tilde B}_i}} \right)} \end{aligned}$$ where $s$ is the total number of retina boundaries one method can delineate.

Parameter Selection
-------------------

There are five parameters in the PDS model: three smooth parameters $\alpha$, $\beta$, $\varphi$ and two time step sizes $\gamma_C$ and $\gamma_b$ used within the gradient descent equations to minimise the functional (\[eq:PDS\]) with respect to $C$ and $b$. In this study we use $\alpha=10$, $\beta=0$, $\varphi=700$, $\gamma_C=10$ and $\gamma_b \ge 2$ suggested in @rossant2015parallel. In addition, as the PDS is a nonconvex model and its segmentation results depend on initialisation. We initialise the parallel curves very closely to the true retinal boundaries for fair comparison with other methods. A maximal number of iterations number 500 is used to ensure convergence of the PDS model. The graph theoretic based methods, i.e., Chiu's method, OCTRIMA3D and Dufour's method, require no parameter input. Finally, our GDM has two build-in parameters: $\lambda$ in (\[eq:weights\]) and $\tau$ in (\[eq:GradientDescentFlow\]). We set $\lambda=10$ and $\tau=0.8$ to detect the retinal layers in the OCT images.

Numerical Results {#NumericalRes}
-----------------

We first visually compare the segmentation results of the proposed GDM method, the PDS (\[eq:PDS\]) and Chiu's graph search method on both the healthy and pathological B-scans, which are shown in Figure \[fig:SegComparison\] (a)-(d). The PDS results as shown in (e)-(h) have some errors on some of the boundaries detected. For instance, the $B_1$ and $B_2$ cannot converge to the true retinal boundaries around the central fovea region, as shown in (f) and (h). This is because the PDS is the classical snake-driven model which has difficulty handling boundary concavity problem. Moreover, due to the fact that the $B_7$ has a much stronger image gradient than the $B_6$ and $B_8$, some parts of these two boundaries have been mistakenly attracted to the $B_7$. As Chiu's graph search method only considers the intensity changes in the pure vertical direction (\[eq:chiu\]), it also fails segment the fovea region layers with strong curvature, as shown in (i)-(l). Moreover, the algorithm cannot handle irregular bumps caused by pathologies very well, which can be observed from the bottom $B_9$ line delineated in (k) and (l). In general, Chiu's method works very nicely when the retinal structures are flat or smooth without big changes on boundary locations. The results by the proposed GDM method, as shown in (m)-(p), performs better than the PDS and Chiu's methods when compared with the ground truth in the last row. As analysed in Section \[GDM\], the gradient weights defined in (\[eq:weights\]) account for both vertical and horizontal variations, making it very suitable for both flat and nonflat retinal structures. Hence, the GDM is a better clinical tool for detecting retinal boundaries from both normal or pathological subjects.

The accuracy of the segmentation results by different methods against ground truth over 30 healthy and 20 pathological B-scans is indicated in Table \[tb:healthyResults\] and Table \[tb:pathologicalResults\], respectively. In order to make the comparison clearer, we plot the data in the two tables in Figure \[fig:plotHealthyResults\] and Figure \[fig:plotPathologicalResults\], respectively.

In Table \[tb:healthyResults\] and Figure \[fig:plotHealthyResults\], the SE shows that the PDS leads to very large segmentation bias with the largest error being 6.01$\mu m$, whilst the bias of the GDM is less than 1.22$\mu m$ for all the retinal layer boundaries. Moreover, the mean SE plot of the GDM is close to zero, which means the GDM are less biased than the other two methods. Large errors of the PDS normally take place at the $B_1$, $B_2$, $B_6$ and $B_8$, which is consistent with visual inspection on the healthy scans in Figure \[fig:SegComparison\]. Furthermore, the mean AE quantities and plots show that the GDM performs the best for all the boundaries. Particularly at the $B_1$ and $B_2$ where the curved fovea region is located, the HD values of the GDM (3.702$\pm$1.62$\mu m$, 7.340$\pm$2.16$\mu m$) are significantly lower than those of the PDS (36.56$\pm$15.9$\mu m$, 29.00$\pm$11.6$\mu m$) and Chiu's method (22.12$\pm$9.23$\mu m$, 21.25$\pm$5.98$\mu m$). However, the accuracy of different methods are comparable at flat or smooth retinal boundaries such as $B_4$, $B_7$ and $B_9$. Finally, as the manual segmentation traces the small bumps of the true boundaries but the segmentation results by the PDS are however very smooth, the overall accuracy of the method is the lowest among all the approaches compared.

\[htbp\]

\[tb:healthyResults\]

\
Mean value\

\
Standard deviation\

In Table \[tb:pathologicalResults\] and Figure \[fig:plotPathologicalResults\], the mean and standard deviation plots show that the GDM is more accurate and robust compared with the other two methods for pathological data. However, larger errors have been found at the last four boundaries $B_6$, $B_7$, $B_8$ and $B_9$ for all the segmentation methods. This is because the dry age-related macular degeneration has led irregularities to these retinal boundaries, making these methods less accurate and robust. The overall accuracy measured by the three quantities has decreased compared with the corresponding measurements listed in Table \[tb:healthyResults\]. Chiu's graph search method using Dijkstra's algorithm can be deemed as a discrete approximation of the proposed GDM. This makes its final results comparable to those of the GDM at some flat retinal boundaries and better than those of the PDS. However, the fast sweeping algorithm used to solve the Eikonal equation guarantees local resolution for the geodesic distance, which significantly reduces the grid bias and achieves sub-pixel accuracy for the geodesic path of the GDM. In addition to the novel weight function proposed in (\[eq:weights\]), the GDM also resolves the metrisation problem caused by discrete graph method and thus can obtain more accurate results than Chiu's method for delineating cellular layers from both normal or pathological subjects.

\[htbp\]

\[tb:pathologicalResults\]

\
Mean value\

\
Standard deviation\

In the next section, the proposed GDM is used to segment the OCT volume dataset that includes samples from ten healthy adult subjects, named as Volume 1 to 10 respectively. Dufour's and OCTRIMA3D methods are also used to segment the same dataset for comparison purposes. In Figure \[fig:3D4Smaple\], we demonstrate four representative segmentation results of GDM on Volume 1, 2, 7 and 9.

\

\
<span>![The comparison between Dufour's method (left), OCTRIMA3D (middle) and GDM (right) on the two B-scans in Figure \[fig:enfaceBscans\]. The segmentation results by these methods are marked with red lines while the ground truth using manual labelling with green lines.<span data-label="fig:2SlicesSeg"></span>](Fig/DRes2 "fig:"){width="32.00000%" height="15.00000%"}</span> <span>![The comparison between Dufour's method (left), OCTRIMA3D (middle) and GDM (right) on the two B-scans in Figure \[fig:enfaceBscans\]. The segmentation results by these methods are marked with red lines while the ground truth using manual labelling with green lines.<span data-label="fig:2SlicesSeg"></span>](Fig/OResult2 "fig:"){width="32.00000%" height="15.00000%"}</span> <span>![The comparison between Dufour's method (left), OCTRIMA3D (middle) and GDM (right) on the two B-scans in Figure \[fig:enfaceBscans\]. The segmentation results by these methods are marked with red lines while the ground truth using manual labelling with green lines.<span data-label="fig:2SlicesSeg"></span>](Fig/OurRes2 "fig:"){width="32.00000%" height="15.00000%"}</span>\

The segmentation results of the three approaches on an exemplary sample (Volume 4) are shown in two distinctive B-scans in Figure \[fig:enfaceBscans\] and \[fig:2SlicesSeg\], where one B-scan retinal structures are quite flat and the other contains the nonflat fovea region. Dufour's method has lower accuracy than the OCTIMA3D and GDM for both cases. OCTRIMA3D extends Chiu's method to 3D space and improves it by reducing the curvature in the fovea region using the inter-frame flattening technique, so the method performs very well for both flat and nonflat retinal structures. However, there still exist some obvious errors on the 5th boundary $B_5$. OCTRIMA3D is able to flatten the $B_1$ and in the meanwhile it also increases the curvature of its adjacent boundaries such as $B_5$, which might be the reason leading to the errors. Compared with the other two, the GDM's results show less green lines, verifying that the results are closer to ground truth and thus it is the most accurate among the three compared. In addition to the 2D visualisation, the 3D rendering of the results segmented by the three approaches is given in Figure \[fig:compare3Dresults\]. The experiment furthermore shows that Dufour's results deviate much from ground truth, while the OCTRIMA3D is better than Dufour's method and comparable to the GDM. The GDM results cover less grey ground truth and are thereby the best.

\
<span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/Dufour2 "fig:"){width="13.50000%" height="7.00000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/OCTIMA3DO2 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/GDM2 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/ORG2 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/Dufour2_1 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/OCTIMA3DO2_1 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/GDM2_2 "fig:"){width="13.50000%"}</span>\
<span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/Dufour3 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/OCTIMA3DO3 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/GDM3 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/ORG3 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/Dufour3_1 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/OCTIMA3DO3_1 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/GDM3_2 "fig:"){width="13.50000%"}</span>\
<span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/Dufour4 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/OCTIMA3DO5 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/GDM5 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/ORG5 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/Dufour4_1 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/OCTIMA3DO5_1 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/GDM5_2 "fig:"){width="13.50000%"}</span>\
<span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/Dufour5 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/OCTIMA3DO6 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/GDM7 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/ORG6 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/Dufour5_1 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/OCTIMA3DO6_1 "fig:"){width="13.50000%"}</span> <span>![The 3D comparison between Dufour's method, OCTRIMA3D and GDM by segmenting the intra-retinal layer surfaces from the Volumes 4 sample. Column (a)-(d) are respectively Dufour's results, OCTRIMA3D results, GDM results and ground truth. Column (e)-(g) are respectively the segmentation results of the three compared methods, overlaid with ground truth. Row 1-6 are the results for the individual surface $B_1$, $B_2$, $B_3$, $B_5$, $B_7$ and total retina surfaces, respectively.<span data-label="fig:compare3Dresults"></span>](Fig/GDM7_2 "fig:"){width="13.50000%"}</span>\

\

\[htbp\]

\[tb:volumeB5\]

\[htbp\]

\[tb:volumeB7\]

\[htbp\]

\[tb:volumeOveall\]

\
<span>![Boxplots for the SE ($\mu m$), AE ($\mu m$), HD ($\mu m$), OSE ($\mu m$), OAE ($\mu m$) and OHD ($\mu m$) obtained by different methods in Table \[tb:volumeB5\]-\[tb:volumeOveall\] for the 10 OCT volumes. 1st row: boxplots of Table \[tb:volumeB5\]; 2nd row: boxplots of Table \[tb:volumeB7\]; 3rd row: boxplots of Table \[tb:volumeOveall\].<span data-label="fig:boxPlotsVolume"></span>](Fig/SEB2 "fig:"){width="28.00000%"}</span> <span>![Boxplots for the SE ($\mu m$), AE ($\mu m$), HD ($\mu m$), OSE ($\mu m$), OAE ($\mu m$) and OHD ($\mu m$) obtained by different methods in Table \[tb:volumeB5\]-\[tb:volumeOveall\] for the 10 OCT volumes. 1st row: boxplots of Table \[tb:volumeB5\]; 2nd row: boxplots of Table \[tb:volumeB7\]; 3rd row: boxplots of Table \[tb:volumeOveall\].<span data-label="fig:boxPlotsVolume"></span>](Fig/AEB2 "fig:"){width="28.00000%"}</span> <span>![Boxplots for the SE ($\mu m$), AE ($\mu m$), HD ($\mu m$), OSE ($\mu m$), OAE ($\mu m$) and OHD ($\mu m$) obtained by different methods in Table \[tb:volumeB5\]-\[tb:volumeOveall\] for the 10 OCT volumes. 1st row: boxplots of Table \[tb:volumeB5\]; 2nd row: boxplots of Table \[tb:volumeB7\]; 3rd row: boxplots of Table \[tb:volumeOveall\].<span data-label="fig:boxPlotsVolume"></span>](Fig/HDB2 "fig:"){width="28.00000%"}</span>\
<span>![Boxplots for the SE ($\mu m$), AE ($\mu m$), HD ($\mu m$), OSE ($\mu m$), OAE ($\mu m$) and OHD ($\mu m$) obtained by different methods in Table \[tb:volumeB5\]-\[tb:volumeOveall\] for the 10 OCT volumes. 1st row: boxplots of Table \[tb:volumeB5\]; 2nd row: boxplots of Table \[tb:volumeB7\]; 3rd row: boxplots of Table \[tb:volumeOveall\].<span data-label="fig:boxPlotsVolume"></span>](Fig/SEB3 "fig:"){width="28.00000%"}</span> <span>![Boxplots for the SE ($\mu m$), AE ($\mu m$), HD ($\mu m$), OSE ($\mu m$), OAE ($\mu m$) and OHD ($\mu m$) obtained by different methods in Table \[tb:volumeB5\]-\[tb:volumeOveall\] for the 10 OCT volumes. 1st row: boxplots of Table \[tb:volumeB5\]; 2nd row: boxplots of Table \[tb:volumeB7\]; 3rd row: boxplots of Table \[tb:volumeOveall\].<span data-label="fig:boxPlotsVolume"></span>](Fig/AEB3 "fig:"){width="28.00000%"}</span> <span>![Boxplots for the SE ($\mu m$), AE ($\mu m$), HD ($\mu m$), OSE ($\mu m$), OAE ($\mu m$) and OHD ($\mu m$) obtained by different methods in Table \[tb:volumeB5\]-\[tb:volumeOveall\] for the 10 OCT volumes. 1st row: boxplots of Table \[tb:volumeB5\]; 2nd row: boxplots of Table \[tb:volumeB7\]; 3rd row: boxplots of Table \[tb:volumeOveall\].<span data-label="fig:boxPlotsVolume"></span>](Fig/HDB3 "fig:"){width="28.00000%"}</span>\

Table \[tb:volumeB5\]-\[tb:volumeOveall\] contain quantitative information for comparing the accuracy of the three methods on the 10 OCT volumes. Table \[tb:volumeB5\] lists the quantities for the surface $B_5$ around the fovea region, and Table \[tb:volumeB7\] presents the numerical results for the surface $B_7$ that is flatter and smoother. In Table \[tb:volumeB5\], the SE quantity indicates that Dufour's method produces larger segmentation bias than the OCTRIMA3D and GDM. The SE values by the GDM are in the range of \[-0.128$\mu m$ 0.6833$\mu m$\], showing less variability than those by the other two methods. Moreover, the GDM leads to the smallest AE and HD quantities in all 10 cases, indicating that the GDM is the best among all the methods. Compared with those in Table \[tb:volumeB5\], the quantities in Table \[tb:volumeB7\] show a significant improvement of all the methods. For example, the range of the HD quantity by Dufour's method has dropped from \[25.688$\mu m$ 56.667$\mu m$\] to \[3.521$\mu m$ 27.853$\mu m$\]. In addition, the accuracy gap between the OCTRIMA3D and GDM has been reduced. The HD values of Volume 3, 7 and 10 by the OCTRIMA has even become smaller than the corresponding values by the GDM. These improvements are the fact that the retinal surface $B_5$ is flat and the voxel values remain fairly constant. From the OAE and OHD in Table \[tb:volumeOveall\] we can observe that the accuracy of the GDM is the highest for the total retina surfaces among the existing approaches.

The corresponding boxplots of Table \[tb:volumeB5\]-\[tb:volumeOveall\] are shown in Figure \[fig:boxPlotsVolume\]. It is clear that the proposed GDM method performs consistently better, with higher accuracy and lower error rates for both flat and nonflat retina layers. The boxplots show that there is little variation in performance across the modelled structures and that even in the worst case scenario the proposed method yields lower error rate than the average performance of other methods. Furthermore, in Figure \[fig:3Dplot\] we present the 3D plots of the SE, AE and HD quantities computed by the three methods on the 10 OCT volumes. The SE values by the GDM are closer to zero and the AE and HD values by it remain smaller. The overall distribution of these discrete data points also indicates that the GDM results are less oscillating. We can thus conclude from Figure \[fig:3Dplot\] that the GDM is the best among all the methods compared for extracting intra-reintal layer surfaces from 3D OCT volume data in terms of both accuracy and robustness.

\

\

\

Computational Complexity Analysis
---------------------------------

The experimental results in Section \[NumericalRes\] have shown that the performance of our algorithm is superior over others in terms of accuracy. In this section the performance of the different approaches in terms of the computational time is demonstrated. We implemented PDS, Chiu's method and GDM using Matlab 2014b on a Windows 7 platform with an Intel Xeon CPU jenniferwright@example.com and 32GB memory. For a $633 \times 496$ sized B-scan, with initialisation close to the true retinal boundaries, it takes 3.625s (500 iterations) for PDS to delineate two parallel boundaries. Chiu's method needs 1.962s to detect one boundary, while the GDM only takes 0.415s. Note that the time complexity of Chiu's graph search method is $O(|E|log(|V|))$, where $|V|$ and $|E|$ are the number of nodes and edges. In the context of boundary detection, $|V|= MN$ and $|E|=8MN$. Hence the time complexity of the method is $O(MNlog(MN))$. In contrast, our GDM solved using fast sweeping only has linear complexity of $O(MN)$, which is more efficient than Chiu's method. Instead of directly doing segmentation in 3D, the OCTRMIA3D explores spatial dependency between two adjacent B-scans and applies Chiu's method to each 2D frame independently. The OCTRMIA3D is thus able to track retinal boundaries in 3D volume efficiently. It has been reported in @tian2015real that the processing time of the OCTRMIA3D for the whole OCT volume of $496\times644\times51$ voxels was 26.15s, which is faster than our GDM (40.25s is used to segment a $496\times633\times10$ sized volume). However, such procedure in the OCTRMIA3D complicates the whole 3D segmentation process and might make the algorithm less general. Finally, Dufour's graph method needs 14.68s to detect the six intra-retinal layers surfaces on a $496\times633\times10$ sized volume. Dufour's method was implemented using a different programming language (C) and delineated different number of retinal surfaces from those of GDM so comparison can not be made between the two methods.

Conclusion
==========

We have presented a new automated segmentation framework based on the geodesic distance for delineating retinal layer boundaries in 2D/3D OCT images. The framework integrates horizontal and vertical gradient information and can thus account for changes in the both directions. Further, the exponential weight function employed within the framework enhances the foveal depression regions and highlights the weak and low contrast boundaries. As a result, the proposed method is able to segment complex retinal structures with large curvatures and other irregularities caused by pathologies. Extensive numerical results, validated with ground truth, demonstrate the effectiveness of proposed framework for segmenting both normal and pathological OCT images. The proposed method has achieved higher segmentation accuracy than existing methods, such as the parameter active contour model and the graph theoretic based approaches. Ongoing research includes integrating the segmentation framework into a system for detection and quantification of retinal fractures and other diseases of the retina.

Appendix
========

We present the 3D fast sweeping algorithm to solve the Eikonal equation (\[eq:eikonalEq\]). Given a seed point $s_1$, its distance function $d(x)$ satisfies the following Eikonal equation $$\left|\nabla d(x)\right|=f(x), x\notin s_1 \label{eq:Eiknoal}$$ with $d(s_1)=0$ and $f(x)=W^{-1}(x)$ where $W$ is defined in (\[eq:weights\]). (\[eq:Eiknoal\]) is a typical partial differential equation and it can be solved efficiently by using the fast sweeping algorithm proposed by Zhao @zhao2005fast. To do so, the Godunov upwind difference scheme is used to discretise (\[eq:Eiknoal\]) as follows $$\left[(d_{i,j,k}^n-d_{xmin}^n)^+\right]^2+\left[(d_{i,j,k}^n-d_{ymin}^n)^+\right]^2+\left[(d_{i,j,k}^n-d_{zmin}^n)^+\right]^2=f_{i,j,k}^2
\label{eq:dicreteEiknoal}$$ In equation (\[eq:dicreteEiknoal\]), $d_{xmin}^n=min(d_{i,j+1,k}^n, d_{i,j-1,k}^n)$, $d_{ymin}^n=min(d_{i+1,j,k}^n, d_{i-1,j,k}^n)$, $d_{zmin}^n=min(d_{i,j,k+1}^n,d_{i,j,k-1}^n)$ and $x^+=\left\{
\begin{array}{cc}
      x & x>0 \\
      0 & x\leq 0
\end{array} 
\right.$. Boundary conditions need to be handled in the computational grid space. One-sided upwind difference is used for each of the 6 boundary faces of the grid space. For example, at the left boundary face, a one-sided difference along the $x$ direction is computed as $$\nonumber
\left[(d_{i,1,k}^n-d_{i,2,k}^n)^+\right]^2+\left[(d_{i,1,k}^n-d_{ymin}^n)^+\right]^2+\left[(d_{i,1,k}^n-d_{zmin}^n)^+\right]^2=f_{i,1,k}^2$$ $d_{xmin}^n$, $d_{ymin}^n$ and $d_{zmin}^n$ are then sorted in increasing order and the sorted version is recorded as $a_1$, $a_2$ and $a_3$. So, the unique solution to (\[eq:dicreteEiknoal\]) is given as follows: $$d_{i,j,k}^{n+1}=min(d_{i,j,k}^n,\widetilde{d_{i,j,k}}) \label{eq:uniSolu}$$ where $\widetilde{d}_{i,j,k}$ is a piecewise function containing three parts $$\nonumber
\widetilde{d_{i,j,k}} = \left\{ \begin{array}{l}
\frac{1}{3}\left( {{a_1} + {a_2} + {a_3} + \sqrt {3f_{i,j,k}^2 - {{({a_1} - {a_2})}^2} - {{({a_1} - {a_3})}^2} - {{({a_2} - {a_3})}^2}} } \right)\\
\frac{1}{2}\left( {{a_1} + {a_2} + \sqrt {2f_{i,j,k}^2 - {{({a_1} - {a_2})}^2}} } \right)\\
{a_1} + {f_{i,j,k}}
\end{array} \right.$$ The three parts correspond to the following intervals, respectively $$\begin{aligned}
f_{i,j,k}^2 \ge  ({a_1} &- {a_3})^2 + {({a_2} - {a_3})^2}\\
{({a_1} - {a_2})^2} \le f_{i,j,k}^2 &< {({a_1} - {a_3})^2} + {({a_2} - {a_3})^2}\\
f_{i,j,k}^2 &< {({a_1} - {a_2})^2}\end{aligned}$$

To solve (\[eq:uniSolu\]), which is not in analytical form, the fast Gauss-Seidel iteration with alternating sweeping orderings is used. For initialization, the value of the seed point $s_1$ is set to zero, and this value is fixed in later calculations. The rest of the points are set to large values, and these values will be update later. The whole 3D grid is traversed in the following orders for the Gauss-Seidel iteration $$\begin{aligned}
    (1)\; i=1:M, j=1:N, k=1:H;\; &(2)\; i=M:1, j=N:1, k=H:1\;\\
    (3)\; i=M:1, j=1:N, k=1:H;\; &(4)\; i=1:M, j=N:1, k=H:1\;\\
    (5)\; i=M:1, j=N:1, k=1:H;\; &(6)\; i=1:M, j=1:N, k=H:1\;\\
    (7)\; i=1:M, j=N:1, k=1:H;\; &(8)\; i=M:1, j=1:N, k=H:1\;\\\end{aligned}$$

[^1]: <span>http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm</span>

[^2]: <span>http://pascaldufour.net/Research/software$\_$data.html</span>

{'source': 'arXiv_out/1609'}