CT scan image segmentation based on hounsfield unit values using Otsu thresholding method

The use of medical images in diagnosing and analyzing various cases in the medical field is commonly used. In certain cases, the image used is not limited to two-dimensional images, but sometimes requires the use of three-dimensional images. CT scan image is an image that has several image slices that can be reconstructed into a three-dimensional image. In the reconstruction process, segmentation plays an important role to get a good reconstruction result and reduce the resulting noise. This study aims to develop a method used in CT scan image segmentation, with the hope that it can simplify the diagnosis process performed by doctors using two-dimensional images or those that have been constructed into three-dimensional images. The main method developed is the Otsu Thresholding method based on the threshold value, which is combined with the Hounsfield unit (HU) value which will be the input for the segmentation process. The image used is a thorax CT scan image with the final goal to get the results of heart segmentation. The results obtained based on the calculation of balanced accuracy for the 30 data tested had an average of 72.54%. The highest result of balanced accuracy for heart segmentation was obtained by data 4 of 77.43%, while the lowest result was obtained by data 29 of 69.1%.


Introduction
The process of diagnosing and analyzing various cases in the medical field often uses medical images to support a more accurate diagnosis. Most of the medical images used are two dimensional images, but in some cases it is also necessary to use three dimensional images. So it requires proper image processing to reconstruct a two-dimensional image into a three-dimensional image. An image that can be reconstructed into a three dimensional image is CT scan image, that has several panoramic image slices. However, sometimes the resulting three dimensional image still has a lot of noise and has not been reconstructed properly, which is due to the weakness of the segmentation process used.
The segmentation process plays an important role in separating objects [1], so that consideration is needed in the use of the right segmentation method. One of the commonly used segmentation methods is the thresholding method which recognizes an image based on a threshold value and then converts it into a binary image. However, this method has a weakness where the threshold value has to be given manually which makes it less efficient. So we need a method that can automatically select the threshold value. One of the developments of this method is the otsu thresholding method, which is considered to be the most effective method in determining the threshold value [2]. So that this method can be used to get an accurate segmentation method for the threshold value. Human tissues have a varied range of threshold values, some of which have a very difficult area to be seen on medical images. Especially the parts of the internal organs that have threshold values that overlap. This makes the need for additional methods to identify the desired tissue to be segmented in order to increase the accuracy of the segmentation results. In general, the image used in the segmentation process is a grayscale image which has 256 gray intensities. The small scale range makes grayscale images have limitations in the segmentation process, this is because the threshold value between one tissue with another that has almost the same tissue density will have almost the same gray intensity value. The CT scan image has a Hounsfield unit (HU) value which has a larger scale range than the grayscale image in general, which consists of 4096 gray intensities [3]. So that it makes the HU value an alternative that can be used in medical image processing, especially CT scan image segmentation.
So this research will try to combine the Otsu Thresholding method based on the threshold value, with the Hounsfield unit (HU) value which will be the input for the segmentation process to get high accuracy values.

Method
This study used 30 CT scan image data of the thorax with the DICOM format, which is a global technology standard for storing digital data information used by the medical field [3]. The CT scan image data is read using the RadiAnt DICOM Viewer 5.5.1 64bit software to obtain information from the image used as research data, specifically the HU value for the organ to be segmented, in this study we used heart as the main focus.
The range of HU values for each of the same organ can be different for CT scan images taken using different energies [4]. This energy difference will affect the photoelectric interactions that occur, so that the absorption of photons against the network that has the same electron density varies [4]. The variation in the absorption value of this material will affect the attenuation coefficient value of the material, causing the resulting HU value to have differences [4]. So that the initial reading of HU data needs to be done to find out CT Scan information that can affect the resulting HU value. To get the average HU value of heart to be used in the segmentation process, with calculation using the following formula: Maximum HU value: Minimum HU value: Where: k = total CT Scan image data to be segmented max = the maximum HU value for the i of data from the organ to be segmented min = minimum HU value for the i of data from the organ to be segmented. After getting the HU value to be used, the image data will be processed using a Python-based segmentation program that goes through several stages, there are 7 stages that must be passed to get the output in the form of segmentation results from the CT Scan image. After the output is obtained, data analysis will be carried out to see the accuracy of the segmentation results obtained using the balanced accuracy calculation. These stages will be shown by workflow diagram in Figure 1.

Rescale HU Value
The process of rescale HU value is carried out if the HU values read in Python and Radiant have different values, so it is necessary to do a calibration related to the HU value. In this study, the image data used had a lower value when read using the Python program, which was 1024 for both the maximum and minimum scales compared to the initial reading process using Radiant. So in this case the rescale process will be carried out by shifting the HU value for each image pixel by -1024.

Crop Image
The rescale image will be used as input to get the ROI (Range of Interest) from the desired part of the image by cropping or cutting the desired portion of the image. The crop process is based on the location of the desired object, namely the heart, by determining the boundary for each direction where the resulting ROI must contain 100% of the heart for each image data. The ROI for each CT scan image that still comes from 1 patient and at the same time of taking the CT scan image must have the same limit for each slice of the resulting image, but if the patient is different, it can have a different ROI limit. To get the limit value can be seen from the illustration in Figure 2.

Edge Detection
The next stage is edge detection using the canny operator, which is the optimal edge detection operator [5]. This algorithm has 3 criteria, provides the minimum error rate, localizes edge points (the distance of the detected edge pixels and the actual edge is very short), and only gives one response for one edge. In addition, denoising is also carried out if the edges that are obtained have too much noise. This stage is done to get the desired image edge, that is a firm and smooth outline of the heart to maintain the shape of the heart.

HU Values Selection
The HU value of the heart that was obtained at the initial stage of the reading, was inputted for heart selection based on the HU value. This stage aims to obtain the results of heart selection which is the part that you want to segment based on the HU value you have. Where the HU value in the CT Scan image will be used to select the HU value in each image pixel. The HU value of the desired object, namely the heart, will be inputted as the upper and lower limit values. After that, the HU value selection process will be carried out in each image pixel, where if the pixel value is within the range of the upper and lower limits, the value will be maintained and identified as an object. Meanwhile, the outside part will be identified as the background.

Replace
The image of the edge detection results and the image selected by HU are combined to get an image of a heart that has a firm and clear contour. This stage is done by entering mathematical logic for each image pixel from each of the same coordinates of the two images to form a new image. Where the pixels that are identified as edges will be retained in value, while other parts that are not identified as edges will be filled with pixel values from the selected HU.

Segmentation (Otsu Thresholding)
The main stage of segmentation uses the Otsu Thresholding method. The Otsu thresholding concept is to automatically group binary images based on the histogram shape, assuming that the image contains two basic classes with a bimodal histogram (foreground and background) [1]. The objective of the Otsu method is to automatically divide the gray image histogram into two different areas without the need for user assistance. The approach is to perform discriminant analysis, that is determining a variable and then maximizing the variable in order to separate the object from the background. The Otsu method calculates the threshold value T automatically based on the input image. For example that the threshold value is expressed in k, which ranges from 1 to L, with L = 4096. Here the Otsu algorithm determines the threshold (k). The value of k ranges from 0 to 4096 with calculation using the following formula [5]: The probability of each pixel at gray level i Cumulative count (zerothCM) Cumulative mean (firstCM) Global mean intensity (tMean) The threshold value k is determined by maximizing the equation:

Denoising
The denoising stage is used to minimize the remaining noise after the segmentation process, denoising is done by using a binary opening operation to eliminate noise outside the heart and binary closing to fill the holes on the inside of the heart. So that you will get the final result of the heart segmentation process. The following is the definition of binary opening and binary closing [6]:

Data Analysis
The performance of the segmentation results is measured based on balanced accuracy calculations [7] for each segmented image, with the formula used as follows: Where True Positive (TP) is the number of pixels where the gound truth image and the image segmentation results is recognized as the selected organ. True Negative (TN) is the number of pixels where the ground truth image and the image segmentation results is not recognized as the selected organ. False Positive (FP) is the number of pixels where the ground truth image is not recognized as the selected organ and image segmentation results is recognized as the selected organ. And False Negative (FN) is the number of pixels where the ground truth image is recognized as the selected organ and the image segmentation results is not recognized as the selected organ.

Result and Discussion
The results of reading the data on 30 CT Scan images using RadiAnt DICOM Viewer 5.5.1 64bit obtained information that the CT Scan image used has a size of 512x512 pixels with a thickness of 1.3 mm, tube voltage of 120 kV and tube current of 301 mA. The result of reading the HU value of the image has the lowest value of -3041 for each data and the highest value range between 1000-1500. After reading it, the CT scan image is entered as input for the Python-based segmentation program and the image will be processed to get the segmentation results through the stages previously described in the method section. Figure 3 shows the output image of the heart that has been segmented, and the comparison with the ROI and pre-cropped image, from 2 different data sets as representations. Data analysis from the results obtained was done by calculating the balanced accuracy of the output by comparing the results with the ground truth for each data. The calculation of ballanced accuracy is based on the formula 13 for each data from a total of 30 data tested. The highest result of balanced accuracy for cardiac segmentation was obtained by data 4 of 77.43%, while the lowest result was obtained by data 29 of 69.1%. With the resulting balanced accuracy has reached an average of above 70%, that is, the average balanced accuracy for the heart segmentation is 72.54%. The results of the balanced accuracy calculation for each data are presented in the graph shown in Figure 4.    Figure 4, the balanced accuracy value generated for each data is in almost the same range. This shows that the segmentation that already has standard results and is not influenced by different image forms. However, the average value which has just reached 72.54%, indicate that the segmentation using the Otsu thresholding method based on HU values still requires an increase to be applied. There are several factors cause the accuracy value still not reaching 90% to be considered a good result.

Balanced Accuracy for Heart Segmentation
The anatomical structure is one of the factors that influence the accuracy value, where the heart is a tissue composed of fluid, namely blood and muscle which is a solid tissue. The majority of other tissues also have a basic arrangement similar to the heart. As a result, the heart has a density similar to various other tissues, and the HU value it has has quite a lot of overlap with other tissues, especially near the heart. This can be seen in the CT scan images that have been displayed previously, where many tissues also have a gray color similar to the color displayed by the heart in the CT scan image.
The similarity in gray in CT Scan shows the number of HU values that intersect between the tissue that is the object of interest and other tissue. Which results in other tissues becoming noise that must be removed. Even though the noise generated by using HU value as input is lower than the gray scale, the combination of methods used still cannot erase the part of the noise caused by other tissues [8]. While noise removal itself plays an important role that must be improved to improve image quality [9]. So that additional methods are needed to be able to correctly identify objects from other points of view.
In addition, the otsu thresholding method used is not suitable if it is applied to certain tissue segmentations in an image, as was done in this study for the heart. This is due to the selection of the T threshold value based only on the image histogram [10]. Where the T threshold value generated by this method is only one that will immediately divide the input image into 2 classes, namely object and background [11]. This method cannot determine two thresholds that have a certain range of values that are characteristic of each tissue, so that it can make other tissues outside the tissue that want to be segmented identified as objects. This method is more effective when applied in structures that have clear and clear boundaries. The segmentation of otsu thresholding needs to be optimized by improving other parts of the image such as edge sharpening [9].

Conclusion
This study has obtained the results of the Hounsfield Unit (HU) CT scan image segmentation using the Otsu Thresholding method based on a balanced accuracy of 72.54% for the heart segmentation results tested on 30 data, the highest accuracy is obtained by 4 of 77.43% data, and the lowest accuracy. by data 29 of 69.1%. Further research is needed to get better performance and accuracy in image segmentation. This research still needs improvement in object recognition and noise removal..