## 2 Materials and Methods
### Data Pre-Processing
#### 2.1.2 Human Heart Segmentation  
The next step of the developed methodology is the segmentation of the human heart, which poses a challenging task due to its complex shape and variability [22]. However, the accurate segmentation of the heart is critical for many clinical applications such as planning for cardiac interventions and treatments, the quantification of cardiac function, and the diagnosis of various cardiac diseases. Human heart segmentation refers to the process of identifying and separating the main regions of the heart. In the present study, the spectral clustering algorithm was considered [23] to cluster six main parts of the heart such as the aorta, the right/left atrium, the right/left ventricle, and the pulmonary artery. In the first step of the segmentation process, an adjacency map is constructed, reading all the vertices and the faces of the reconstructed heart 3D model that was determined in the previous paragraph. Hereupon, knowing all the connected edges of the 3D point cloud of the reconstructed heart, a distance matrix is developed that takes into account the geodesic as well as the angular distance between all the adjacent faces of the model. In the next phase, the affinity matrix A is established, determining how similar or close two points are in the 3D space, and is defined as [24]:  
\[A[i][j]=exp\frac{-d^{2}\big{(}s_{i}\cdot s_{j}\big{)}}{\sigma^{2}} \tag{1}\]  
where \(d\) (\(s_{i}\), \(s_{j}\)) is a distance metric mentioned earlier, \(\sigma\) composes a scale parameter selected manually, and \(S\) is a set of points \(S=\{s_{1},s_{2},\ldots,s_{n}\}\) that need to be clustered into \(k\) (six in the examined case) subsets. If \(A[i][j]=0\), this means that the vertices \(s_{i}\) and \(s_{j}\) are not connected via an edge. The subsequent step is the definition of the diagonal degree matrix \(D\) as in [25] and the construction of the Laplacian \(L\) (Equation (2)):  
\[D[i][i]=\sum_{j=1}^{n}A[i][j] \tag{2}\]  
Figure 2: (**a**) Steps for the 3D reconstruction process. (**b**) Outcomes of the applied methodology concerning the investigated clinical case. \[L=D^{-1/2}AD^{-1/2} \tag{3}\]  
The methodology of the spectral clustering algorithm suggests the computation of the first k eigenvectors \(u_{1}\), \(u_{2}\), \(\ldots\), \(u_{k}\) of the Laplacian \(L\) as well as the creation of the matrix \(U=[u_{1},\,u_{2},\,\ldots,\,u_{k}]\), redefining the input space as a k-dimensional space [25]. It must be noted that the eigenvectors are ordered according to their corresponding eigenvalues. Finally, the clustering of this subspace can be accomplished via the utilization of a standard clustering technique like the k-means algorithm, producing \(k\) clusters for the investigated human heart. Results of the employed methodology are displayed in Figure 3, wherein the left part a subsampled model of the reconstructed model of the heart is displayed. Due to computational time, the spectral clustering algorithm is first executed on a subsampled 3D model. Nevertheless, the segmentation of the full-heart reconstructed 3D model was also conducted via the iteration of each vertex and its calculation to the closest vertex of the subsampled model, thus reducing the computational time. Finally, depending on the cluster of the closest vertex, the corresponding vertex of the dense 3D model was assigned to a similar cluster. Even though the vertices that are located close to the borders of the clusters can potentially be placed in the wrong part of the heart, the gain in the computation time compensated the restricted number of misplaced vertices. It should be noted that manual post-processing of the segmented 3D model could lead to an ideal representation of the examined heart, repairing potential imperfections of the reconstructed heart, as shown in the next paragraphs. In the left part of Figure 4, the examined segmented aorta is illustrated as it was derived from the clustering process, exhibiting a typical case of coarctation of the aorta (CoA).