Kluwer  Handbook of Biomedical Image Analysis Vol
.1.pdfImproving the Initialization, Convergence, and Memory Utilization 
365 
In shape models prior knowledge of the global structure is included using a parameterized template of a speciﬁc structure. Free form deformable templates, like snakes, have no explicit global structures as the prior knowledge includes basically local continuity and smoothness constraints.
Considering as a functional energy minimization process, the snake model consists of an initial model which is carried to the desired object boundary by forces described by the Euler–Lagrange equations. In a different way, the snake evolution can be formulated by local deformations to reshape dynamically the initial model in a process which do not apply minimization techniques explicitly. The former is the formulation used by Kass et al. [42] in the original snake model. It will be described next.
7.2.1 Original Model
Geometrically, a snake is a parametric contour c, here assumed to be closed, embedded in a domain D !2:
c : [0, 1] → D !2, c (s) = (x (s) , y (s)) . 
(7.1) 
We can deﬁne a deformable model as a space of admissible deformations (contours) Ad and a functional E to be minimized [18]. This functional represents the energy of the model and has the form:



E : Ad → !, 





(7.2) 



E(c) = E1(c(s)) + E2(c(s)) , 



where 



8 

8 


8 

8 




E1 
= 

w1 
c (s) 
2 
+ w2 
c (s) 
2 
ds, 
(7.3) 

8 
8 
8 
8 













E2 
= P(c(s)) ds 







(7.4) 
are the internal and external energy terms, respectively. In the internal energy expression, the parameter w1 (tension) gives the snake the behavior of resisting the stretch and w2 (rigidity) makes the snake less ﬂexible and smoother. These parameters can be constants or dependent on s [44]. Each prime denotes a degree of differentiation with respect to the parameter s.
366 
Giraldi, Rodrigues, Marturelli, and Silva 
In the external energy E2, P is a potential related with the features we seek. For edge detection in a grayscale image a possible deﬁnition is [6]:
P = − I 2 , 
(7.5) 
where I is the image intensity.
The process of minimizing the functional given in (7.2) can be viewed from a dynamic point of view by using the Lagrangian mechanics. This leads to dynamic deformable models that unify the description of shape and motion. In these
models the deformable contour is viewed as a timevarying curve: 

c (s, t) = (x (s, t) , y (s, t)) , 
(7.6) 
with a mass density µ and a damping density γ .
In this formulation, the Lagrange equations of motion for a snake with potential energy given by expression (7.2) have the form [44, 50]:
µ 
∂2c 
+ γ 
∂c 
+ w1c (s) + w2c (s) + P(c(s)) = 0, 
(7.7) 
∂t2 
∂t 
where the ﬁrst two terms represent the inertial and damping forces while the third and fourth terms give the forces related to the internal energy (Eq. (7.2)). The last term in Eq. (7.7) is the external force due to the external potential P in expression (7.5). Equilibrium is achieved when the internal and external forces balance and the contour comes to rest; which implies that:
∂c/∂t = ∂2c/∂t2 = 0. 
(7.8) 
In general, Eq. (7.7) does not have analytical solutions. Thus, numerical methods must be considered. Henceforth, in order to solve this equation, for an initial closed contour, we have to discretize the snake in space and time by using ﬁnite differences or ﬁnite elements methods, each of them with tradeoffs between performance and numerical efﬁciency [19,44]. We also have to use a termination condition, based on Eq. (7.8), to stop the numerical interactions [44].
It is important to observe that the space Ad in expression (7.2) does not include contours with more than one connected component. So the classical snake model does not incorporate topological changes of the contour c during its evolution given by Eq. (7.7). Besides, the contraction force generated by the third and fourth terms in this equation is shape dependent and makes the stabilization of the snake too dependent on the parameters w1 and w2. While in theory it is possible to compute a pair of proper weights of the internal energy for each point, it is very difﬁcult in practice [79].
Improving the Initialization, Convergence, and Memory Utilization 
369 
Figure 7.2: Two snakes colliding with the inside grid nodes and snaxels marked.
Each mesh node is called a node element and each pair of connected nodes vi, v j is called a model element.
The node elements are linked by springs, whose natural length we set to
zero. Hence, a tensile force can be deﬁned by:
αi 
j 
S 
, 
where S 
c 
· 
r , 
(7.11) 
−→ = 
−→ij 

−→ij = 

ij 

c is a scale factor and rij = vi − v j is the length of the corresponding model element. The model also has a normal force which can be weighted as follows [49]:
Fi = k(signi)ni, 
(7.12) 
where ni is the normal vector at node i, k is a scale factor, and signi = +1 if
I(vi) > T and signi = −1 otherwise (T is a threshold of the image I). This force is used to push the model toward image edges until it is opposed by external image forces.
The forces deﬁned by Eqs. (7.11) and (7.12) are internal forces. The external force is deﬁned as a function of the image data, according to the interested features. Several different approaches have been adopted according to the application [34, 77]. In our case, it can be deﬁned as follows:
image :: force :: fit = −γi P, P = I 2 . 
(7.13) 
The evolution of the surface is controlled by the following dynamical system:
i 
= i 
+ 
−→ + 
−→ 
t 
+ −→ 
t 


v(t+ t) 
vt 

hi αi t 
Fi 

fi 

, 
(7.14) 
where hi is an evolution step.
During the Tsurfaces evolution, some grid nodes become interior to a surface. Such nodes are called burnt nodes and its identiﬁcation is required by the update of the characteristic function [49]. To deal with selfintersections, the Tsurfaces model incorporates an entropy condition: Once a node is burnt it
370 
Giraldi, Rodrigues, Marturelli, and Silva 
stays burnt. A termination condition is set based on the number of deformation steps in which a simplex has remained a transverse one.
7.2.4 Level Sets
It will be useful to review some details of level sets, which is the implicit formulation presented in [46]. The main idea of this method is to represent the deformable surface (or curve) as a level set {x !3G(x) = 0} of an embedding function:
G : !3 × !+ → !, 
(7.15) 
such that the deformable surface (also called front in this formulation), at t = 0, is given by a surface S:
S (t = 0) = +x !3G (x, t = 0) = 0, . 
(7.16) 
The next step is to ﬁnd an Eulerian formulation for the front evolution. Following Sethian [46], let us suppose that the front evolves in the normal direction
−→ −→
with velocity F , where F may be a function of the curvature, normal direction, etc.
We need an equation for the evolution of G(x, t), considering that the surface
S is the level set given by: 

S(t) = +x !3G(x, t) = 0, . 
(7.17) 
Let us take a point x(t), t !+, of the propagating front S. From its implicit deﬁnition given above, we have:
G (x (t) , t) = 0. 
(7.18) 
Now, we can use the chain rule to compute the time derivative of this expression:
Gt + F  G = 0, 
(7.19) 
−→
where F = F is called the speed function. An initial condition G(x, t = 0) is required. A straightforward (and expensive) technique to deﬁne this function is to compute a signeddistance function as follows:
G(x, t = 0) = ±d, 
(7.20) 
Improving the Initialization, Convergence, and Memory Utilization 
371 
where d is the distance from x to the surface S(x, t = 0) and the signal indicates if the point is interior (−) or exterior (+) to the initial front.
Finite difference schemes, based on a uniform grid, can be used to solve Eq. (7.19). The same entropy condition of Tsurfaces (once a grid node is burnt it stays burnt) is incorporated in order to drive the model to the desired solution (in fact, Tsurfaces was inspired on the level sets model [50]).
In this higher dimensional formulation, topological changes can be efﬁciently implemented. Numerical schemes are stable, and the model is general in the sense that the same formulation holds for 2D and 3D, as well as for merge and splits. Besides, the surface geometry is easily computed. For example, the front normal and curvature are given by:
−→ = 


= · 
G(x, t) 



n 
G(x, t) , 
K 

G(x, t) 

, 
(7.21) 










respectively, where the gradient and the divergent ( ·) are computed with respect to x.
7.3Initializing Traditional Deformable Models
In the area of deformable models, the deﬁnition of the initial estimation (see Eq. (7.9)) from which we can start the model evolution (the initialization step) is a difﬁcult and important task. Problems associated with ﬁtting the model to data could be reduced if a better start point for the search were available. In this section, we show a set of methods used to ﬁnd the initial curve (or surface).
We start with methods that use image statistics and morphological techniques, and later we present modern approaches, such as neural nets.
7.3.1 RegionBased Approaches
The simplest way to initializing deformable models is through a preprocessing step in which the structures of interest are enhanced.
This can be done by image statistics extracted by image histograms or pattern recognition techniques [69] (see [39] for a recent review). These statistics can be represented by a mean µ and variance σ of the image ﬁeld I or any other ﬁeld
Improving the Initialization, Convergence, and Memory Utilization 
373 
arise even when the images are preprocessed with more robust segmentation approaches, such as image foresting transformation [23] or other fuzzy techniques [70, 76]. These problems make thresholdbased methods not very adequate for deformable models initialization.
In the following section, we discuss an approach to improve the automatic detection of an initial curve.
7.3.2 Mathematical Morphology for Initialization
The use of mathematical morphology to initialize deformable models is a subject with few references in the literature [59, 76].
For the particular case of medical images, the general idea is to isolate objects of interest (such as lungs, arteries, heart, bones, etc.) in the scene and to work with them individually, avoiding neighboring interference of other objects, noise, spurious artifacts, or background.
Mathematical morphology is a known set of mathematical tools used in digital image processing area to perform linear transformations on the shapes of images’s regions. There are two basic morphological operations: erosion and dilation. They will be deﬁned next to make this text selfcontained.
Let us take the image X and a template B, the structuring element. They will be represented as sets in twodimensional Euclidean space. Let Bx denote the translation of B so that its origin is located at x. Then the erosion of X by B is deﬁned as the set of all points x such that Bx is included in X, that is,
erosion : X # B = {x : Bx X}. 
(7.23) 
Similarly, the dilation of X by B is deﬁned as the set of all points x such that Bx hits X, that is, they have a nonempty intersection:
dilation : X B = {x : Bx ∩ X = φ}. 
(7.24) 
These two operations are the base of all more complex transformations in mathematical morphology. For example, we can use an opening which consists of an erosion followed by a dilation of the result. This operation allows one to disconnect two different regions for treating them separately. The dual of opening is the close operation, which consists of an erosion over the dilation’s result. The effect of closing an image is rightly the opposite of opening: It connects weak separated regions (see [40] for a review of other useful operations).
374 
Giraldi, Rodrigues, Marturelli, and Silva 
(a) 
(b) 
(c) 
(d) 
Figure 7.5: (a) Edge map after using the canny algorithm in the image of Fig. 7.3. ( b) Erosion result over the Canny algorithm output. (c) Isolated region of interest. (d) Final result after dilation.
In this section, we are interested in applying morphological chains (sequence of a morphological operations) techniques to isolate speciﬁc regions in medical images. These extracted regions will be used for initializing deformable models.
We begin with a grayscale image such as in Fig. 7.3. Firstly, an edge detection ﬁlter is applied. The Canny edge detector was used [9], despite the fact that there are many other possibilities [13, 35, 40]. Figure 7.5(a) gives the result of applying the Canny methodology over the image in Fig. 7.3.
In Fig. 7.5(a) note that the two white predominant regions at the center of the image are the two lungs, which are the regions of interest. For convenience, this image was inverted with regard to its black–white pixels before initializing the morphological process. In this case, when applying the erosion operation (Eq. (7.23)) over the image in Fig. 7.5(a), we eliminate artifacts, weak edges, and separate weak connected regions. The net effect is to attenuate or eliminate highfrequency components. In the example of Fig. 7.5(a), we used a crossstructuring element. The result can be seen in Fig. 7.5( b).
Now, the two bigger regions are detached from the other ones, and we can separate and treat them individually. Figure 7.5(c) shows this result.
To restore the original size of the lung, we can apply the dilation operation (Eq. (7.24)). The result can be seen in Fig. 7.5(d).
Finally, an algorithm for isoline extraction gives the polygonal curve pictured in Fig. 7.5(d). This curve is an approximation of the desired boundary. It can be used as the initial curve for a deformable model.