In this section, we present our algorithm for extracting the boundary curve of a free-boundary surface from a noisy local likelihood map of the surface defined in a 3D image. Then we present our algorithm for surface extraction. The former algorithm consists of retracting the fronts (closed surfaces) generated by the Fast Marching algorithm to obtain curves on the free-boundary surface of interest. We therefore review Fast Marching in the first sub-section before defining our novel algorithms for free-boundary surface extraction.
3.1 Fronts Localized to the Surface Using Fast Marching
We use the Fast Marching Method [3] to generate a collection of fronts that grow from a seed point and are localized to the surface of interest. We denote by \(\phi : \mathbb {Z}_n^3 \rightarrow \mathbb {R}^+\), where \(\mathbb {Z}_n = \{ 0, 1, \ldots , n-1 \}\), a noisy function defined on each pixel of the given image grid. It has the property that (in the noiseless situation) a small value of \(\phi (x)\) indicates a high likelihood of the pixel x belonging to the surface of interest.
Fast Marching solves, with complexity \(O(N\log N)\) where N is the number of pixels, a discrete approximation \(U : \mathbb {Z}_n^3 \rightarrow \mathbb {R}^+\) to the eikonal equation:
$$\begin{aligned} {\left\{ \begin{array}{ll} |\nabla U(x)| = \phi (x) &{} x\in \mathbb {Z}_n^3 \backslash \{ p \} \\ U(p) = 0 &{} \end{array}\right. } \end{aligned}$$
(1)
where \(\nabla \) denotes the spatial gradient, and \(p \in \mathbb {Z}_n^3\) denotes an initial seed point. For our situation, p will be required to lie somewhere on the surface of interest. The function U at a pixel x is the weighted minimum path length along any path from x to p, with weight defined by \(\phi \). U is called the weighted distance. A front (a closed surface, which we hereafter refer to as a front to avoid confusion with the free-boundary surface) evolving from the seed point at each time instant is equidistant (in terms of U) to the seed point and is iteratively approximated by Fast Marching. As noted by [2], a positive constant added to the right hand side of (1) may be used to induce smoothness of paths. The front, evolving in time, moves in the outward normal direction with speed proportional to \(1/\phi (x)\). Fronts can be alternatively obtained by thresholding U at the end of Fast Marching.
3.2 Retracting Fronts for Curves on the Surface
If we choose the seed point p to be on the free-boundary surface of interest, the front generated by Fast Marching will travel the fastest when \(\phi \) is small (i.e., along the surface) and travel slower away from the surface, and thus the front is elongated along the surface at each time instant (see Fig. 3). Our algorithm is based on the following observation: points along the front at a time instant that have traveled the furthest (with respect to Euclidean path length), i.e., traveled the longest time, compared to nearby points tend to lie on the surface of interest. This is because points traveling along locations where \(\phi \) is low (on the surface) travel the fastest, tracing out paths that have large arc-length.
This property can be more readily seen in the 2D case (see Fig. 3): suppose that we wish to extract a curve from a seed point, and we do so by using Fast Marching to propagate a front. At each time, the points on the front that travel the furthest with respect to Euclidean path length lie on the 2D curve of interest. This has been noted in the 2D case by [4]. In the 3D case (see Fig. 3), we note this generalizes to ridge points
Footnote 1 of the Euclidean path length \(d_E\) (defined next) likely lie on the surface of interest. To define Euclidean path length \(d_E\), define a front \(F = \{ x\in \mathbb {Z}_n^3 \,:\, U(x) \in [D, D+\varepsilon ) \}\) where \(\varepsilon >0\) is small. The function \(d_E : F\rightarrow \mathbb {R}^+\) is such that \(d_E(x) \) is the Euclidean path length of the minimal weighted path (w.r.t to the distance U) from x to p. Note that \(d_E\) is easy to obtain by keeping track of another distance \(U_E\) that solves the eikonal equation with the right hand side of the first equation in (1) equal to 1, while propagating the front to compute U.
The fact that ridge points likely lie on the surface is visualized in the right of Fig. 3: points on the intersection of the surface and the front are such that in the direction orthogonal to the surface, the minimal paths have Euclidean lengths that decrease since \(\phi \) becomes large in this direction, thus minimal paths travel slower in this region, so they have lower Euclidean path length. Along the surface, at the points of intersection of the surface and front, the path length may increase or decrease, depending on the uniformity of \(\phi \) on the surface. This implies points on the intersection of the front and surface are ridge points of \(d_E\).
Since ridge detection computed directly from its definition is sensitive to noise, scale spaces [23, 24] are often used. However, this approach, while being more robust to noise, may distort the data, and it is often difficult to obtain a connected curve as the ridge. Therefore, we derive a robust method by retracting the front to the ridge curve by an ordered removal of free faces (based on lowest to highest ordering based on \(d_E\)). The two dimensional cubicle complex \(C_F\) of the front at a time instant is constructed as follows:
-
\(C_F'\) contains all 2-faces f in \(\mathbb {Z}_n^3\) between any 3-faces \(g_1, g_2\) with the property that one of \(g_1,g_2\) has all its 0-sub-faces with \(U < D\) and one does not.
-
Each face f of \(C_F'\) has cost equal to the average of \(U_E\) over 0-sub-faces of f.
-
\(C_F\) removes from \(C_F'\) face f with minimum cost and the smallest local minima with distance (determined by the seed point and f) away from f.
The last operation punctures the front at two locations (on both sides, with respect to the ridge, of the front) so that it can be retracted to the ridge curve. The ridge curve can be computed by removing free pairs until no free faces are left. This is described in Algorithm 1. We note the computational complexity of this extraction is \(O(N\log N)\) where N is the number of pixels.
An example of ridge curves detected is shown in Fig. 4. This procedure of retracting the Fast Marching front is continued for different fronts of the form \(\{ U < D \}\) with increasing D. This forms many curves on the surface of interest. In practice, in our experiments, D is chosen in increments of \(\varDelta D = 20\), until the stopping condition is achieved, and this typically results in 10–20 ridge curves extracted. The next sub-section describes the stopping criteria.
3.3 Stopping Criteria and Surface Boundary Extraction
To determine when to stop the process of extracting ridge curves, and thus obtain the outer boundary of the surface of interest, we make the following observation. Parts of the curves generated from the previous section move slowly, i.e., become close together with respect to Euclidean distance at the boundary of the surface. This is because the speed function \(1/\phi \) becomes small outside the surface. Hence, for the curves \(c_i\) generated, we aim to detect the locations where the distance between points on adjacent curves becomes small. To formulate an algorithm robust to noise, we formulate this as a graph cut problem [15].
We define the graph G as follows:
-
vertices V are 0-faces in all the 1-complexes \(c_i\) formed from ridge extraction
-
edges E are \((v_1,v_2)\) where \(v_1, v_2\in V\) are such that \(v_1, v_2\) are connected by a 1-face in some \(c_i\) or \(v_1\) is a 0-face in \(c_i\) and \(v_2\) is the closest (in terms of Euclidean distance) 0-face in \(c_{i+1}\) to \(v_1\)
-
a cost \(|v_j-v_k|\) is assigned to each edge \((v_j,v_k)\) where \(v_j\) and \(v_k\) belong to different \(c_i\) (so that the min cut will be where adjacent curves are close)
-
for edges \((v_j,v_k)\) such that \(v_j\) and \(v_k\) belong to the same \(c_i\), the cost is the minimum Euclidean distance between segment \((v_j,v_k)\) and segments on \(c_{i+1}\)
-
the source is the seed point p, and the sink is the last ridge curve \(c_l\).
We wish to obtain a cut of G (separating G into two disjoint sets) with minimum total cost defined as the sum of all costs along the cut. In this way, we obtain a cut of the ridge curves along locations where the distance between adjacent ridge curves is small. The process of obtaining ridge curves from the Fast Marching front is stopped when the cost divided by the cut size is less than a pre-specified threshold. This cut then forms the outer boundary of the surface. The computational cost of the cut (compared to other parts of the algorithm) is negligible as the graph size is typically less than \(0.5\,\%\) of the image. Figure 4 shows an example of a cut that is obtained. Figure 5 shows a synthetic example.
3.4 Surface Extraction
Given the surface boundary curve determined from the previous section, we provide an algorithm that determines a surface going through locations of small \(\phi \) and whose boundary is the given curve. Our algorithm uses the cubicle complex framework and has complexity \(O(N\log N)\). Although there is another algorithm, [8], for this task, it is computationally expensive as we show in Sect. 4.
We retract the cubicle complex of the image with the constraint that the boundary curve and faces joining to it cannot be removed. We accomplish this retraction by an ordered removal of free faces based on weighted path length U determined from Fast Marching to form the surface of interest. This results in fronts that have large distance U from the seed point being removed first. By the constraint, only the parts of the fronts that do not touch the boundary can be removed. As the removal progresses, faces are removed on either side of the surface. This creates a “wrapping” effect around the surface of interest, which have small values of U. Near the end of the algorithm, points on the surface cannot be removed without creating a hole, so no faces are free, and thus the algorithm stops. The algorithm is described in Algorithm 2.
Figure 5 shows a synthetic example of the evolution of this algorithm. Figure 6 additionally shows the result of surface extracted from the data used in Fig. 4.