# Innovative Tool for Automatic Detection of Arterial Stenosis on Cone Beam Computed Tomography
## 2 Materials and Methods
### User Interface  
The proposed tool includes a graphical user interface (GUI) that allows the user to view the analysis results both in 3D and 2D representation. The 3D representation shows the vessel skeleton, color-coded according to the estimated diameter of the vessel, providing the user with explicit information about the thickness of each vessel directly on the 3D representation of the vessels. Each point of each vessel in the tree is painted using a color  
Figure 3: Distance transform. (**a**) Frame of the output image resulting from the application of the distance transform on the binary mask produced by the segmentation of the vessels. (**b**) The corresponding frame of vessels’ binary mask. coding scheme based on the classic \"jet\" colormap, where smaller vessels appear as dark blue; as the diameter grows, these appear lighter up to the larger ones, which appear as bright red. From this representation, the user can select a single vessel composed of several tree segments, for a detailed analysis of the diameter. The procedure begins by selecting the first segment of the vessel, which turns red, while all adjacent segments of the vascular tree are highlighted in green. At this point, the user may select multiple segments, which are consecutively added to the vessel under study. Once a new segment is selected, the representation is updated by drawing all selected segments in red, while the green color identifies the segments that may be further selected for extending the vessel, i.e., segments connected at one of the extremities of the vessel itself. In order to provide a more detailed view of the variation of the diameter along the selected vessel, the tool also provides a 2D view mode. This two-dimensional plot provides a means to make the search for stenosis more intuitive for medical doctors, compared to the 3D visualization of the skeleton. When the user selects a vessel on the skeleton, the corresponding link and pixels that belong to it are identified and the corresponding linear representation appears, where the horizontal axis represents a linear coordinate \(L_{t}\) along the vessel axis, and the vertical axis indicates the corresponding vessel diameter. The points on the x-axis are estimated as an integral of the Euclidean distance \(\Delta L_{i}\) between each pair of consecutive points in the list describing the structure of the vessel tree. The measure of the diameter of the vessel is obtained by representing, on the y-axis, the value \(r_{i,k}\), associated with each pixel of the branch \(k\) (or branches) chosen on the skeleton. The plot is also mirrored along the x-axis, to provide a better visual representation of the vessel structure. The diameter and length of the vessel are scaled in real units (mm) referringto two DICOM tags present in the original pre-contrast CBCT image: the pixel spacing and the slice thickness. The first one is expressed by a pair of values \((\widehat{x},\widehat{y})\) that correspond, respectively, to the spacing between the centers of adjacent rows (mm) and the spacing between the centers of adjacent columns (mm) of the image. The other one is represented by \(\widehat{z}\), which corresponds to the nominal slice thickness measured in mm. Information about the length of the vessel is obtained as \(L_{t}=\sum_{0}^{t}\Delta L_{i}\), where \(\Delta L_{i}\) is computed using the following equation:  
\[\Delta L_{i}=\sqrt{(x_{i}-x_{i-1})^{2}\widehat{x}^{2}+(y_{i}-y_{i-1})^{2} \widehat{y}^{2}+(z_{i}-z_{i-1})^{2}\widehat{z}^{2}} \tag{1}\]  
where \((x_{i},y_{i},z_{i})\) are the coordinates of the \(i\)-th voxel on the axis of the vessel. As for the vessel diameters, since CBCT scanners acquire isotropic volumes, both DICOM tags have the same value, \(v\). Thus, diameter conversion from pixel units into millimeters is performed by multiplying \(r_{i,k}\) by \(v\).