# Real-Time Automated Segmentation and Classification of Calcaneal Fractures in CT Images
## 2 Materials and Methods
### Step 2: Segmentation of the Calcaneus Fragments
#### 2.5.3 Classification of Calcaneal Fractures in Sagittal Images  
Figure 12 defines the steps for determining the type of calcaneal fracture in sagittal images. The calcaneus region is divided into three equal areas where each area represents an extra-articular region: Type A (left), Type B (middle), and Type C (right). The fracture classification in sagittal image is based on the area of the fracture line. However, it is slightly difficult to separate the lines from the bone structure. Thus, the median filter [31] is applied to reduce the ambiguity between a bone structure and fracture, as shown in Figure 13a. Then, the automatic contrast enhancement [32] is implemented to obtain a clear fragment separation in bone structure, as shown in Figure 13b. The image histogram, which shows the relationship between the gray level and the corresponding frequency, can be expressed as:  
\[I_{hist}(z)\ =\ \frac{\Delta_{z}}{\Delta} \tag{12}\]  
where \(\Delta_{z}\) is the number of pixels in \(z\), and \(\Delta\) is the total number of pixels in the input image. The histogram equalization (HE) accumulates a histogram of the pixel values in the input image, then displaces all pixel values to enhance the contrast. HE with interval \([0,D-1]\) can be computed by:  
\[Map_{z}\ =\ F(j)\ =\ (D-1)\sum_{z\ =\ 1}^{j-1}I_{hist}(z) \tag{13}\]  
where \(Map_{z}\) indicates an _F(j)_ mapping function that maps every pixel value \(j\) from the input image to \(Map_{z}\), and \(D\) is the dynamic range of HE in the output image.  
Figure 13c shows the Otsu segmentation, which is implemented to convert Figure 13b into a binary image. Figure 13d shows the erosion and dilation which makes the fracture line more obvious. Figure 13e shows the fracture lines and fragmented areas using a contour detection algorithm (see Section 2.5.2). The largest blob is selected as the calcaneus region and other blobs can be recognized as fractures. Figure 13e indicates that there is more than one fracture line detected in the calcaneus region. Then, the largest line is selected to determine the type of fracture, based on the line position in the calcaneus body, as shown in Figure 14a.  
Figure 11: Fragment segmentation: (**a**) Contour detection and (**b**) Color segmentation.  
Figure 14a indicates the area of the selected fracture line. In Figure 14b, the calcaneal fracture is classified as Type B, since most of the area of the fracture is in the middle region. In the case of fragments, the region of each fragment is selected, as shown in Figure 15a. Figure 15b shows the fracture type (called Type B in the middle region), which is determined by the area between the two fragments.  
Figure 12: Algorithm for determining the type of calcaneal fracture in sagittal images.  
Figure 13: (**a**) Apply median filter; (**b**) Contrast enhancement; (**c**) Otsu segmentation; (**d**) Morphological operations; and (**e**) Fracture detection.  
Figure 16 shows another case of fragment detection. Figure 16a shows the area of two fragments detected in the same region. Since the smaller fragment is inside the larger fragmented region, only the largest fragment will be selected as shown in Figure 16. Figure 16c indicates this calcaneal fracture is classified as Type A, since the left area consists of two fragmented regions.