# Three-Dimensional (3D) Model-Based Lower Limb Stump Automatic Orientation
## 3 Results  
The validation of the proposed algorithm was performed using experimental data obtained by 3D scanning followed by 3D model reconstructions for seven different patient cases as summarized in Table 1. To validate the tests under different initial conditions, prior to the test each 3D model was randomly oriented. Since there is no \"gold standard\" for an automated algorithm in the field, the results of the automatic orientation algorithm were compared against manual positioning by an experienced prosthetic expert. For the quantitative comparison between the automated and the expert manual positioning, two pivot points, one on the distal and one on the proximal planes, were selected, and a straight line connecting these two points was fitted. Once the model orientation was performed independently by the automated algorithm and manually by the expert, the two spatially oriented models were matched by the point in the distal plane. Three projections of the straight line on the xy, xz and zy planes were obtained for both automated and manually oriented models, and angles between these projections in each plane were used for the quantitative comparison between the two approaches, as summarized in Table 1. In the above procedure, the exact locations of the pivot points are not critical for the accuracy of the comparison, since they are used for measuring relative orientations only. Although in this work we focused on the lower limb stump orientation problem, the proposed algorithm appears to be a universal tool for the 3D model orientation. We have implemented the algorithm using Python programming language and Mesh library features (the source code is available as Supplementary Material). The developed software module follows the algorithm represented below in pseudocode (see Algorithm 2). The algorithm contains two key verification conditions, with the first condition checking whether the virtual anatomical axis of the tibia coincides with the vertical \(Z\)-axis, while the second condition triggering if the model is positioned with the stump end up after orientation. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Case No**} & \multirow{2}{*}{**Cross Sections**} & **Measurement by an** & **Measurement by a** & **Difference between the** \\  & & **Automated Algorithm, mm** & **Prosthetics Expert, mm** & **Results, mm** \\ \hline \multirow{4}{*}{1} & 1 cross section & 149.800 & 157.847 & 8.046 \\ \cline{2-5}  & 2 cross section & 302.437 & 317.164 & 14.727 \\ \cline{2-5}  & 3 cross section & 206.625 & 206.36  
Since the construction of the cross-sections depends explicitly on the anatomic characteristics of the lower limb stump, it is specified by the operator for each 3D-model in an individual range. The axis of the model should coincide with the Z-axis, since this orientation is required for a more intuitive manual positioning by the expert, who is more used to traditional technology assuming the adjustment of the stump cast installed vertically. After the manual adjustment is performed, the entire model can be re-positioned and re-oriented as required to match with the actual biomechanical axis. The angle of the virtual axis along the tibia to the vertical Z-axis is affected by the angle of the 3D-model slice after scanning. Figure 5 compares the models obtained after orientation, where (_a_) is an expert oriented 3D-model, while 3D-models (_b_)-(_f_) are different variant of 3D-model oriented by the proposed algorithm. The 3D-model gradually shortens the end above the knee. The data obtained show the following: the shorter the femoral part of the 3D-model, the smaller the deviation of the virtual anatomical axis of the tibia from the vertical Z-axis. Data import (e.g., reading from file): array Data(3, N), where N-number of points.