## 1 Introduction
### Generalized Gradient Vector Flow and Divergence Map  
An active contour or snake is a curve defined within a given 2D image \(I(x,\,y)\) and subjected to modifications under the action of forces, until the evolving curve fits well into a final contour [6, 7, 8]. In traditional parametric models, a snake is expressed explicitly by equations \(\vec{x}(s)=\left(x(s),\,y(s)\right)\), \(s\in\left[\![0,1]\!\right]\). The final shape of the contour to be extracted will be such as to minimize an energy functional that is the sum of an internal energy associated with it and an external energy related to a potential function, thus we have:  
\[E\left(\vec{x}(s)\right)=\left[E_{\mathit{int}}\left(\vec{x}(s)\right)+E_{ \mathit{Ent}}\left(\vec{x}(s)\right)\mathrm{d}s\right.\]  
the first term represents the internal energy that is in relation to the degree of flexibility of the active contour, so expressed:  
Figure 1: Anisotropic diffusion and fractional anisotropy. \[E_{\text{lat}}\left(\vec{x}(s)\right)=\int\frac{1}{2}\Bigg{[}\alpha(s)\cdot\left| \frac{\mathrm{d}\vec{x}}{\mathrm{d}s}\right|^{2}+\beta(s)\cdot\left|\frac{ \mathrm{d}^{2}\vec{x}}{\mathrm{d}s^{2}}\right|^{2}\Bigg{]}\mathrm{d}s \tag{1}\]  
where \(\alpha(s)\) is a function that controls the contour tension, while \(\beta(s)\) regularizes its rigidity. The external energy \(E_{\text{Ext}}\left(\vec{x}(s)\right)\) is the energy associated with an external conservative force field, given by the gradient of a potential energy function \(P(\vec{x}(s))\), deriving from the intensity image \(I(x,\,y)\), for example as follows:  
\[E_{\text{Ext}}\left(\vec{x}(s)\right)=\int P\left(\vec{x}(s)\right)\mathrm{d}s =-\int\left|\
abla I(x,y)\right|^{2}\mathrm{d}s\]  
where \(\
abla\) is the gradient operator. By using a variational approach [9], a contour that minimizes the total energy must satisfy the Euler-Lagrange equation:  
\[-\frac{\mathrm{d}}{\mathrm{d}s}\bigg{(}\alpha\frac{\mathrm{d}\vec{x}}{ \mathrm{d}s}\bigg{)}+\frac{\mathrm{d}^{2}}{\mathrm{d}s^{2}}\bigg{(}\beta\frac {\mathrm{d}^{2}\vec{x}}{\mathrm{d}s^{2}}\bigg{)}=\vec{F}_{\text{Ext}}\left( \vec{x}\right) \tag{2}\]  
where \(\vec{F}_{\text{Ext}}\left(\vec{x}\right)=-\
abla P\left(\vec{x}(s)\right)\) are the external forces. From minimization of energy we derive a resolution of a static problem. By introducing a time-variable \(t\), we may realize a deformable model able to create a geometrical shape that evolves over time. In this way, neglecting the inertial term and thus the second order derivatives, the active contour \(\vec{x}(s,t)=(x(s,t),y(s,t))\) must satisfy the differential dynamic equation of the first order:  
\[ \begin{cases}\frac{\partial\vec{x}\left(s,t\right)}{\partial t}=\alpha\,\frac {\partial^{2}\vec{x}\left(s,t\right)}{\partial s^{2}}-\beta\,\frac{\partial^{ 4}\vec{x}\left(s,t\right)}{\partial s^{4}}+\vec{F}_{\text{Ext}}\left(\vec{x}\right) \\ \vec{x}\left(s,0\right)=\vec{x}_{o}\left(s\right)\end{cases}  \tag{3}\]  
where elasticity and rigidity are considered as constant functions and \(\vec{x}_{o}\left(s\right)\) defines an initial curve. When the solution \(\vec{x}(s,t)\) is stabilizing, time derivatives will become null and we carry out the solution of Equation (2). In order to reduce the considerable sensitivity of this model to initial contours, edge detection may be performed using a different class of external forces, the GGVF force field or Generalized Gradient Vector Flow obtained by solving a diffusion problem [10; 11; 12].