# Automatic Tortuosity Estimation of Nerve Fibers and Retinal Vessels in Ophthalmic Images
## 2 Methods
### Curvilinear Structure Enhancement  
Typically, the quality of acquired ophthalmic images exhibits varying conditions of illumination and noise, primarily due to the imperfect focus and acquisition process. The imbalanced intensity dims the appearance of curvilinear structures, such as nerve fibers in CCM imagery, and thus creates difficulty in distinguishing the nerve fibers and estimating their tortuosity from the background [29]. In this paper, we introduce the local phase tensor-based filter to enhance the curvilinear structures in ophthalmic images. The local phase is a measure of the structural information of an image, which is able to distinguish intrinsic features from background with the illumination invariant advantage [30]. Given a curvilinear structure image signal as \(f(x)\), the definition of the local phase is:  
\[\varphi(x)=\arctan\Bigl{(}\frac{E(x)}{O(x)}\Bigr{)}, \tag{1}\]  
where \(E(x)\) is the convolution operation response of \(f(x)\) through the even filter. \(O(x)\) is the response of convolution operation of \(f(x)\) through the odd filter. Here, the odd filter is the Hilbert transform of the even filter. In practice, \(E(x)\) and \(O(x)\) are usually calculated by the log-Gabor filter:  
\[E(x)=\operatorname{Re}\{\mathscr{F}^{-1}(\operatorname{LG}(\omega)\times \mathscr{F}(x))\}, \tag{2}\]  
\[O(x)=\operatorname{Im}\{\mathscr{F}^{-1}(\operatorname{LG}(\omega)\times \mathscr{F}(x))\}, \tag{3}\]  
where \(\mathscr{F}(x)\) is the Fourier transform of the image signal. The LG indicate the log-Gabor filtering. \(\mathscr{F}^{-1}\) is the inverse Fourier transform. Re and Im indicate the real part and the imaginary part of it expression, respectively. The symmetric aspect \(T_{even}\) of local phase tensor is calculated as [31]:  
\[T_{even}=[H(E(x))]\cdot[H(E(x))]^{T}, \tag{4}\]  
while the asymmetric aspect \(T_{odd}\) is  
\[T_{odd}=-0.5\times\{[\
abla(O(x))]\cdot[\
abla\
abla^{2}(O(x))]^{T}+[\
abla \
abla^{2}(O(x))]\cdot[\
abla(O(x))]^{T}\}, \tag{5}\]  
In these equations, \(\
abla\) and \(\
abla^{2}\) denote the Gradient and Laplacian operations, respectively. \(H\) is the Hessian operation. The \(T_{even}\) is the product of the term \(H(E(x))\) with its transpose. According to the conclusion in [30], the local phase tensor equation is:  
\[\mathcal{T}=\sum_{\theta\in\Theta}\left[\sqrt{(T_{even}^{\theta})^{2}+(T_{odd }^{\theta})^{2}}\right]\cdot\cos(\varphi). \tag{6}\]Furthermore, we also consider multiple orientations to make the rotation invariant tensor, where \(\Theta=\{\frac{\pi}{16},\frac{2\pi}{16},\frac{3\pi}{16},\cdots,\pi\}\). \(\varphi\) is the phase parameter, which is calculated from the local contrast. Figure 2a,e are the original images. Figure 2b,f illustrate the curvilinear structure enhanced images. Figure 2d,h are the curvature maps. Since the filters are usually calculated for the whole image, the tortuosity values of the bifurcation points are also calculated. However, the value of the bifurcation should not have impact on the evaluation of tortuosity, so we break the bifurcations and remove the tortuosity values.