 object form, was used to define an object [26,27,28]. Each landmark is manually placed to represent the area of interest in each training image. Meanwhile, each training image consists of coinciding landmarks. In this study, we used 43 landmarks to specify the femoral and tibial shapes. A set of landmarks is indicated as vector A as shown in Eq. (1). Each shape of training image (A) consists of landmarks where each coordinate point (x, y) with the order of points 1 to n and A is presented in vector form. T superscript in Eq. (1) shows the form of matrix transposition. Figure 3 shows an example of 43 landmarks used for training images to segment the right femoral and tibial shape.
Furthermore, scaling, rotating, and translating to minimize the sum of squared error between the landmark lengths were some methods used for alignment of vector A. Accordingly, the mean shape for the alignment of training shape (A) and covariance of the matrix (S) was computed as follows: where A is the average of A as shown in Eq. (2). A is also known as zero mean. s is the number of training images with sequence i starting from 1 to s. Meanwhile, x i is the intensity value of pixels in the i training image. in Eq. (3) shows the average of x i ; meanwhile, S is a covariance matrix.
In this research, Principal Component Analysis (PCA) was used to determine the major axis of variation for the femoral and tibial bone correspondence landmarks in the 10 training images. This procedure is applied by using eigenvalue decomposition of the covariance matrix. A matrix P, where P ¼ ðp 1 jp 2 j:::jp t Þ is a matrix of new features obtained from the multiplication of eigenvectors corresponding to eigenvalues (λ i ), with a zeromean matrix (A). While the eigenvectors and eigenvalues are obtained from the covariance matrix (S) in Eq. (3) uses Singular Value Decomposition (SVD) function in Matlab 2018b. t is the number of eigenvalues to retain to ensure that their sum is sufficient to explain the variance in the training shapes. Van Ginneken [26] recommended that the variance ranges should be defined from 90% to 99.5% of the sum of eigenvalues. To adhere to this recommendation, we used 98% of the sum of eigenvalues. Moreover, Eq. (4) was used for the approximation of the femoral and tibial forms in the training images: The values of b are set to be within the range of AE3 ffiffiffi ffi λ i p to restrict newly generated shapes to be in the allowable shape domain.
Furthermore, the shape model was merged with the femoral and tibial images. The shape model was placed near the center location of the femoral and tibial area using a single-click manual interaction. The searching process was initialized from coarse searching to fine adjustment of each corresponding landmark to fit the shape of the femoral and tibial area in the knee X-ray image. Initialization was usually done using the mean shape with translation, rotation, and scale parameters close to their correct values. At each iteration, we consider points on and to either side of the contour along the normal direction. Subsequently, the landmark position is updated as the point with minimum Mahalanobis distance. After having processed all landmarks, the closest plausible shape was obtained by projecting the updated landmarks onto the eigenspace. The search process was halted once the set number of iterations was achieved. The obtained shape was then converted into a binary image to illustrate the shape of the femoral and tibial area as the visible object, while the remaining portion of the image is set as the background. Figure 4 (b) is an example of the results of the segmentation of the femur and tibia that are different from the previous image. In this figure, the femur and tibia are well segmented using the ASM.

Manual segmentation
Manual segmentation in this study is used as ground truth, which is a reference to compare with the computational method developed (ASM). The ground truth was obtained by complete manual delineation of the object boundaries by a human observer. The following are the steps in establishing ground truth: first, reading x-ray images of the knee to be segmented; second, changing the image to grayscale; third, resizing the image to 3484 Â 4262 (the same size as ASM segmentation); fourth, displaying the x-ray image of the knee; fifth, manually drawing the edge of the femur-tibia with the help of the cursor; sixth, displays the image after being segmented; and, finally, saving the image.

Validation of the segmentation
To measure the accuracy of this segmentation method, this research uses Hausdorff Distance (HD) [29,30]. The directed HD (Ĥ) between two point sets E and F is the maximum of distances between each point x ε E, and its nearest neighbor y ε F. That is where k:; :k is any norm. Note that b H ðE; FÞ 6 ¼ b HðF; EÞ and thus the directed HD is not symmetric. H is the maximum of the directed HD in both directions, and, therefore, it is symmetric. H is given by Eq. (7): E is the point that represents ASM segmentation while F is the point that represents manual segmentation. To obtain these points, the algorithm used is the following: In this study, we proposed an edge operator with a scheme as shown in Figure 5. The definition of edge operator elements in the algorithm above is all pixel entries in Figure 5 other than pixel elements (b, c). The next step is measuring HD from the points surrounding the femur-tibia, which have been obtained both from the results of manual and ASM segmentation. HD measurements are calculated based on Eqs. (6) and (7). From these measurements, the results are in the form of pixels. Previously, raw data information (DICOM from OAI) was obtained by raw data interpolation, in which pixel resolution was 0.37 mm Â 0.37   Additionally, this research also used the Dice Similarity Coefficient (DSC). The DSC is a spatial overlap index and validation of matrix reproducibility. The DSC values range from 0 (indicating no spatial overlap between two sets of binary segmentation results) to 1 (indicating complete overlap) [31,32,33]. In this case, the DSC measures the spatial overlap between the two segments, the target areas A and B, where A is the result of manual segmentation (ground truth), B is the result of segmentation of the ASM method and \ is the intersection so that the DSC is defined as Eq. (8).

Thinning of the femoral and tibial area
Thinning or skeletonization is considered a pre-processing technique, which is one of the most crucial steps [34,35]. Thinning is a process that peels pixels of a binary image as much as possible while preserving the connectivity of the original image. Moreover, this process also extracts image contours until it reaches the most medial one-pixel width. The purpose of thinning is to reduce unnecessary, or redundant, parts so that only the essential information is generated.
In the thinning procedures, we use a mathematical morphology operations. This operation is performed by utilizing the hit-and-miss operators, usually also called erode and dilate. The basic operations involved in HMT are complement, intersection, erosion, and dilation [34,35]. The thinning of a set (C) by structure element (D), denotes the convolution, so that C D can be defined regarding HMT as shown in Eq. (9).
where C D is also designated as erosion, (CʘD) is designated as dilation, and \ is designated as an intersection; meanwhile, (CʘD) c is the complement of (CʘD). A more useful expression for thinning C symmetrically is based on a Structuring Elements (SE) sequence of Eq. (10).
where D i is a rotated version of D iÀ1. Meanwhile, D 1, D 2, …, D n is a sequence of SE as a result of the rotation version of D iÀ1. The SE commonly used are diamonds, squares, and hexagons. In this study, we used diamonds. We apply this concept to define thinning by a sequence of SE as follows: The process involves thinning C once with D 1, then thinning the result once again with D 2, and repeating this process until C is thinned with once D n. The entire process is repeated until no further changes occur. Each thinning pass is performed using Eq. (9). One example of the results of thinning is shown in Figure 6. The figure shows a successfully obtained midline of the femur and tibia. This image is needed for the next step, which is determining the FTA.

Automatic FTA determination
To perform FTA measurements automatically, we proposed a new method consisting of several steps: 1. The input image from the results of thinning. Make a color change for pixels (i) that is less visible (has a low-intensity value or i > 0) to 255 (white), in order to be easily distinguished. 2. Look for all pixels with an intensity value ¼ 255, then save the row and column (coordinates) of the pixel. Searching for pixel intensity values is performed from the left row to the right row, then from the top column to the bottom column. 3. Sort pixel coordinates (which have intensity values 255) from small to large. The purpose of sorting coordinates is to make it easier to search branching points. 4. Record the points that will become candidate branches with conditions if there is the same value in each row. Then the column coordinates of the same row are also recorded