## 2 Materials and Methods
### System Architecture
#### 2.3.2 Blood Vessels Tortuosity Index  
Another essential metric in the evaluation of lung lesions is the tortuosity index as it indicates the regular or irregular aspect of blood vessels present inside the evaluated ROI. The more the aspect is regular, the better. When the evaluated lesion has a malignant character, the blood vessels tend to be fewer, thinner, and curlier, due to the invasion of the pulmonary arteries and irregularity of the neo-angiogenesis, becoming twisted or having a curly appearance. To evaluate the tortuosity index, all of the identified vessels in the previously defined ROI must be analyzed.  
The designated region is subsequently transformed into a binary picture, wherein blood vessels are recognized as separate entities. These vessels are modeled using a linear polynomial equation, depicting them as straight lines. This linear approximation establishes a reference for quantifying vessel curvature by contrasting the real vessel shapes with their idealized straight-line representations.  
Throughout this procedure, anomalies in the binary image, including solitary \"zero\" pixels within vascular structures, are rectified. The isolated pixels, referred to as \"holes\", are detected and filled to enhance the accuracy of the vessel's structural representation. Rectifying these irregularities guarantees a more accurate representation of the vessel's form. The operation stops when the condition is met:  
\[X_{k}=X_{k+1} \tag{2}\]  
\[X_{k}=(X_{k-1}\oplus\text{B})\cap A^{C} \tag{3}\]  
Figure 1: System architecture. **(a1,b1,c1)** show input Doppler US images, while **(a2,b2,c2)** display Doppler US input images with defined regions of interest (ROI). The system extracts three vascularization parameters: blood vessel area percentage, vessel tortuosity, and vessel orientation index. These features are processed by a feed-forward neural network, which classifies the lesion as benign or malignant.  
The skeletonization of the vessels is executed to condense their representation to lines of single-pixel width. This involves delineating the primary trajectory of the vessel between bifurcation points and terminuses. Edge erosion is executed iteratively until just the vessel's skeleton persists. The number of iterations is dependent upon the vessel's thickness, with thicker vessels necessitating more iterations to attain a single-line representation.  
Next, the tortuosity index is calculated by assessing the deviation between the real vessel trajectory previously determined and its linear approximation. The vascular tortuosity index (TI) was computed by comparing the actual vessel trajectory with its linear approximation. The tortuosity index was calculated as:  
\[TI=\frac{L_{actual}}{L_{straight}}-1 \tag{4}\]  
where \(L_{actual}\) represents the total vessel length and \(L_{straight}\) represents the straight-line distance between vessel endpoints. A higher \(TI\) value indicates increased vessel curvature, which is characteristic of malignancy. In a most basic scenario, a vessel with no curvature will exhibit no distance between the real trajectory and the approximation line. The deviation between the actual trajectory and the approximation for curved vessels is calculated and aggregated across all pertinent sites. This offers a quantitative assessment of the vessel's tortuosity. Figure 2 exemplifies this procedure below.