# A Liver Segmentation Algorithm with Interactive Error Correction for Abdominal CT Images: A Preliminary Study

P. Vaidehi Nayantara, Surekha Kamath, K. N. Manjunath, K. V. Rajagopal

► To cite this version:

P. Vaidehi Nayantara, Surekha Kamath, K. N. Manjunath, K. V. Rajagopal. A Liver Segmentation Algorithm with Interactive Error Correction for Abdominal CT Images: A Preliminary Study. 4th International Conference on Computational Intelligence in Data Science (ICCIDS), Mar 2021, Chennai, India. pp.132-140, 10.1007/978-3-030-92600-7_13. hal-03772944

HAL Id: hal-03772944

https://inria.hal.science/hal-03772944v1

Submitted on 8 Sep 2022

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
<figure><img src="image_2.png" /></figure>

ifip

International Federation for Information Processing

This document is the original author manuscript of a paper submitted to an IFIP
conference proceedings or other IFIP publication by Springer Nature. As such, there
may be some differences in the official published version of the paper. Such
differences, if any, are usually due to reformatting during preparation for publication or
minor corrections made by the author(s) during final proofreading of the publication
manuscript.
# A Liver Segmentation Algorithm with Interactive Error Correction for Abdominal CT Images: A Preliminary Study

P Vaidehi Nayantaraª, Surekha Kamathª*, Manjunath K Nᵇ, Rajagopal K Vᶜ

ªDepartment of Instrumentation and Control Engineering, Manipal Institute of Technology, Manipal Academy of Higher Education, Manipal, Karnataka, 576104, India

ᵇDepartment of Computer Science and Engineering, Manipal Institute of Technology, Manipal Academy of Higher Education, Manipal, Karnataka, 576104, India

ᶜDepartment of Radiodiagnosis and Imaging, Kasturba Medical College, Manipal Academy of Higher Education, Manipal, Karnataka, 576104, India

* Corresponding author: Department of Instrumentation and Control Engineering, Manipal Institute of Technology, Manipal Academy of Higher Education, Manipal, Karnataka, 576104, India, Tel: 0820-2925152

surekha.kamath@manipal.edu

**Abstract.** An automatic method for segmenting the liver from the portal venous phase of abdominal CT images using the K-Means clustering method is described in this paper. We have incorporated an interactive technique for correcting the errors in the liver segmentation results using power law transformation. The proposed method was validated on abdominal CT volumes of fifteen patients obtained from Kasturba Medical College, Manipal. The average values of the various standard evaluation metrics obtained are as follows: Dice coefficient = 0.9361, Jaccard index = 0.8805, volumetric overlap error = 0.1195, absolute volume difference = 4.048 %, average symmetric surface distance = 1.7282 mm and maximum symmetric surface distance = 38.039 mm. The quantitative and qualitative results obtained in our preliminary work show that the K-Means clustering technique along with power law transformation is effective in producing good liver segmentation outputs. As future work, we will attempt to automate the power law transformation technique.

**Keywords.** Preprocessing, Liver Segmentation, Power Law Transformation, K-Means clustering.

## 1 Introduction

Segmentation of the liver from the abdominal Computed Tomography (CT) image is essential for the computer based diagnosis of hepatic diseases and liver surgery planning [1, 2]. But the pixel intensity of liver parenchyma is very similar to its adjacent organs like stomach, heart, kidney, etc., making it difficult to extract only the liver region from the abdominal image [3, 4]. Hence portions of these adjacent organs also
get segmented along with the liver. Another factor that complicates the segmentation
process is the presence of large peripheral or border tumors in the liver. These tumors
often get excluded from the segmented liver region yielding impractical segmentation
results.

Several papers have been published on liver segmentation [5–12]. Most of the research focused on automating the segmentation process with no provision for manual intervention to identify and correct the erroneously segmented slices in the CT dataset of the patient. Automation is essential but may not always be practical as there may be errors in the segmented output. These errors must be corrected to get accurate outcomes in computer-assisted systems used for hepatic disease diagnosis and surgery. Accuracy is foremost in medical applications and no algorithm can guarantee to always produce accurate results. Hence it is essential to incorporate some method for interactive correction of the erroneously segmented results.

We have attempted to segment the liver from the images obtained in the portal venous CT phase using the K-Means clustering algorithm. Power law transformation interactively corrected the erroneously segmented images. Our preliminary work has shown promising results both qualitatively and quantitatively. There is no work published on liver segmentation that uses power law transformation for error correction to the best of our knowledge. The paper is structured as follows: Section 2 describes the methods adopted in the proposed work, Section 3 presents the results and discussion; conclusion and insights into the future work are provided in Section 4.

## 2 Methods

The different steps in the proposed liver segmentation method are depicted in the flow
diagram shown in Fig. 1. It mainly consists of four stages: preprocessing, K-Means
clustering based liver segmentation, postprocessing and an error correction block based
on power law transformation. Each of these stages are detailed in the following
subsections. The results obtained at the different stages of the algorithm for a particular
input image are illustrated in Fig. 2.
<figure><img src="image_3.png" /><figcaption>Fig. 1. Flow diagram of the proposed liver segmentation algorithm.</figcaption></figure>

## 2.1 Preprocessing

The images considered in this work are in Digital Imaging and Communications in Medicine (DICOM) format. The images are first converted from CT numbers to Hounsfield Units (HU) using Eq 1 [13],

$$HU = CT\text{number} \times \text{Rescale\_Slope} + \text{Rescale\_Intercept} \quad (1)$$

where *CTnumber* is the stored value at each image point and the values of *Rescale_Slope* and *Rescale_Intercept* are obtained from the DICOM file itself using the respective tags.

The pixel values obtained after the above transformation are windowed to 0-255 range according to the pseudocode given below for two reasons: (i) to make them
suitable for display, (ii) since images in HUs did not give satisfactory segmentation results. The pseudocode for the same adapted from [14] is shown below.

n = number of output gray levels (i.e., 256)
w = Window width - 1.0
c = Window center - 0.5
if (HU <= c-0.5*w), then Windowed value=0
else if (HU > c+0.5*w), then Windowed value = n-1
else Windowed value = ((HU-c)/w + 0.5) * (n-1)

Here the values of Window width and Window center are obtained from the DICOM file. The image obtained after these operations is shown in Fig. 2 (a).

To remove the ribs, spine, etc. (referred to as white region in this paper) from the windowed CT image, the pixels with intensity above 250 are mapped to 0. Then unsharp masking is performed to sharpen the image. Unsharp masking is an image enhancement technique in which sharp details like edges are accentuated in two steps. First, the blurred version of the image (low pass filtered) is subtracted from the original image to obtain the sharp details. Then these details are scaled and added back to the original image to get the sharpened image [15]. Mathematically, it is defined as,

$$f_{sh}(x, y) = f(x, y) + c * (f(x, y) - f_{bl}(x, y)) \quad (2)$$

where $f_{sh}(x, y)$ is the sharpened image, $f(x, y)$ is the original image, $f_{bl}(x, y)$ is the blurred version of the original image and c is the scaling factor. For blurring the image, the Gaussian filter with standard deviation, $\sigma=1$ was used, and the scaling factor, c chosen, was 0.8. The image thus obtained is shown in Fig. 2(b).

## 2.2 K-Means Clustering and Postprocessing

The liver segmentation is done by the K-Means clustering algorithm to segment the CT volume into three clusters. The three clusters correspond to: (i) the background region, (ii) the liver and other structures with similar gray level intensity and (iii) the non-hepatic areas. The initial centroids were selected using the k-means++ algorithm. The algorithm consists of two stages. The first stage calculates the K centroids and the second stage assigns each point to the cluster with the nearest centroid. Once the grouping is done, it recalculates the new centroid for each cluster by averaging the data points. This process is repeated till there is no change in the centroids (less than 0.0001). The image corresponding to the liver cluster is shown in Fig. 2(c).

Several morphological operations like opening, closing, hole filling and largest connected component extraction are performed in the postprocessing stage to remove imperfections like holes, bridges, etc. and retain only the liver. After performing these operations, we get the binary mask of liver shown in Fig. 2(d). The liver image shown in Fig. 2(e) is obtained by multiplying the binary mask of liver with the windowed image of Fig. 2(a).
<figure><img src="image_4.png" /><figcaption>**Fig. 2.** Results of the proposed liver segmentation algorithm. (a) Input abdominal CT image after windowing (b) Output after white region removal and unsharp masking (c) Output of K-Means clustering based segmentation (d) Binary mask of the liver after postprocessing (e) Segmented liver.</figcaption></figure>

## 2.3 Interactive error correction

Power law transformation was used for correcting the segmentation errors that resulted after segmenting some of the complex datasets. Power law transformation is a basic gray-level transformation function that is used for performing image enhancement. It is mainly used for contrast manipulation and gamma correction [16].
Mathematically, it is defined as,

$$s = cr^{\gamma} \qquad (3)$$

where c and γ are positive constants; r and s are values of pixels before and after enhancement.

The incorrectly segmented images were corrected interactively by varying the value of γ in Eq. 3 to adjust the contrast between the liver and its adjacent organs or between the liver and its peripheral tumors. The power law transformed images were again subjected to K-Means clustering and postprocessing in order to get the correctly segmented output. Fig. 3 illustrates how the power law transformation method helps in correcting the incorrectly segmented results.

<figure><img src="image_5.png" /><figcaption>Fig. 3. Correction of incorrectly segmented outputs using power law transformation. (a) Input abdominal CT image (b) Incorrectly segmented output (c) Segmented output after application of power law transformation.</figcaption></figure>

## 3 Results and discussion

We implemented the proposed liver segmentation algorithm in MATLAB R2020b. The evaluation of the algorithm was done both qualitatively and quantitatively. The qualitative analysis and the generation of the ground truth mask were done under the
supervision of a senior radiologist with more than twenty years of experience. The ground truth was generated using the ITK-SNAP tool [17].

Six metrics, namely Dice Coefficient (DC), Jaccard Index (JI), Volumetric Overlap Error (VOE), Absolute Volume Difference (AVD), Average Symmetric Surface Distance (ASSD) and Maximum Symmetric Surface Distance (MSSD) were used for evaluating the quality of segmentation. The different metrics compute the segmentation accuracy from different perspectives viz. volume overlap and surface distance perspectives. DC and JI indicate the amount of overlap between the segmented and ground truth volumes. AVD indicates the difference in the size of the two volumes. The ASSD and MSSD indicate the closeness of the surface voxels of the two volumes. For DC and JI, values closer to 1 indicate better segmentation, whereas, for the rest, values nearer to 0 indicate better results [18, 19].

The quantitative results in terms of the above mentioned six metrics are given in Table 1. The CT volumes (portal venous phase) of fifteen different patients obtained from Kasturba Medical College (KMC), Manipal, were used for segmentation evaluation. Twenty consecutive liver slices were selected from each of the fifteen patient CT volumes for evaluating the proposed algorithm. Hence, in Table 1, each dataset corresponds to the abdominal CT volume of a patient comprising twenty consecutive liver slices.

<table><caption>**Table 1.** Quantitative evaluation results of the proposed algorithm on 15 patient datasets.</caption><thead><tr><th>Dataset no.</th><th>DC</th><th>JI</th><th>VOE</th><th>AVD<br>(in %)</th><th>ASSD<br>(in mm)</th><th>MSSD<br>(in mm)</th></tr></thead><tbody><tr><td>1</td><td>0.9253</td><td>0.8611</td><td>0.1389</td><td>4.2690</td><td>1.1670</td><td>132.4307</td></tr><tr><td>2</td><td>0.8989</td><td>0.8164</td><td>0.1836</td><td>12.6408</td><td>3.8375</td><td>28.4008</td></tr><tr><td>3</td><td>0.9336</td><td>0.8755</td><td>0.1245</td><td>5.5231</td><td>0.7301</td><td>18.5428</td></tr><tr><td>4</td><td>0.9459</td><td>0.8974</td><td>0.1026</td><td>2.3014</td><td>2.6676</td><td>42.2225</td></tr><tr><td>5</td><td>0.9519</td><td>0.9083</td><td>0.0917</td><td>4.2044</td><td>2.4149</td><td>54.7608</td></tr><tr><td>6</td><td>0.9392</td><td>0.8854</td><td>0.1146</td><td>5.8780</td><td>1.7038</td><td>16.5062</td></tr><tr><td>7</td><td>0.9432</td><td>0.8926</td><td>0.1074</td><td>5.3560</td><td>1.7164</td><td>18.8641</td></tr><tr><td>8</td><td>0.9750</td><td>0.9512</td><td>0.0488</td><td>1.7162</td><td>1.3819</td><td>11.7804</td></tr><tr><td>9</td><td>0.9222</td><td>0.8557</td><td>0.1443</td><td>2.3571</td><td>1.0467</td><td>36.2227</td></tr><tr><td>10</td><td>0.9347</td><td>0.8774</td><td>0.1226</td><td>0.5670</td><td>0.6148</td><td>7.5158</td></tr><tr><td>11</td><td>0.9429</td><td>0.8920</td><td>0.1080</td><td>3.6765</td><td>2.7004</td><td>40.7182</td></tr><tr><td>12</td><td>0.9290</td><td>0.8673</td><td>0.1327</td><td>4.6857</td><td>0.8551</td><td>44.4336</td></tr><tr><td>13</td><td>0.9482</td><td>0.9016</td><td>0.0984</td><td>3.7210</td><td>1.7413</td><td>40.2279</td></tr><tr><td>14</td><td>0.9436</td><td>0.8933</td><td>0.1067</td><td>1.6448</td><td>1.6548</td><td>29.1049</td></tr><tr><td>15</td><td>0.9081</td><td>0.8316</td><td>0.1684</td><td>2.1789</td><td>1.6906</td><td>48.8543</td></tr><tr><td>Average</td><td>0.9361</td><td>0.8805</td><td>0.1195</td><td>4.0479</td><td>1.7282</td><td>38.0390</td></tr></tbody></table>
The average values of the standard metrics achieved by our algorithm (DC = 0.9361, JI = 0.8805, VOE = 0.1195, AVD = 4.0479 %, ASSD = 1.7282 mm and MSSD = 38.039 mm) were promising. The best values for DC, JI and VOE were 0.9750, 0.9512 and 0.0488, respectively, corresponding to Dataset 8 and the best values for AVD, ASSD and MSSD were 0.5670 %, 0.6148 mm and 7.5158 mm, respectively corresponding to Dataset 10. These results show that the algorithm is effective in segmenting the liver from the abdominal CT volume. Specifically, it has shown the effectiveness of the power law transformation technique in correcting the segmentation errors. The main pitfall of the method is the need to input the gamma value manually. In the future, we intend to formulate a method for automatically computing this value based on the attributes of the input image.

# 4 Conclusion and future work

We have performed a preliminary study to segment the liver from the abdominal CT volume using the K-Means clustering technique. An interactive error correction with power law transformation method was also incorporated in our algorithm. We have achieved good qualitative and quantitative results with some of the challenging datasets. One drawback of the algorithm is that the error correction technique is semiautomatic. As future work, we will formulate a method for automatically computing the gamma value for the power law transformation method based on the contrast, intensity values, histogram and other factors associated with the input image.

**Acknowledgments.** The work is supported by KStePS, DST, Government of Karnataka, India. The authors are grateful to Manipal Institute of Technology, MAHE, Manipal for providing the facilities to carry out the research and Kasturba Medical College, Manipal, for providing the patient data.

# References

1. P. Campadelli, E. Casiraghi, and A. Esposito, "Liver segmentation from computed tomography scans: A survey and a new algorithm," Artif. Intell. Med., vol. 45, no. 2–3, pp. 185–196, 2009, doi: 10.1016/j.artmed.2008.07.020.

2. S.-J. Lim, Y.-Y. Jeong, and Y.-S. Ho, "Automatic liver segmentation for volume measurement in CT Images," J. Vis. Commun. Image Represent., vol. 17, no. 4, pp. 860–875, 2006, doi: https://doi.org/10.1016/j.jvcir.2005.07.001.

3. M. Moghbel, S. Mashohor, R. Mahmud, and M. I. Bin Saripan, "Review of liver segmentation and computer assisted detection/diagnosis methods in computed tomography," Artif. Intell. Rev., vol. 50, no. 4, pp. 497–537, 2018, doi: 10.1007/s10462-017-9550-x.

4. A. Gotra et al., "Liver segmentation: indications, techniques and future directions," Insights Imaging, vol. 8, no. 4, pp. 377–392, 2017, doi: 10.1007/s13244-017-0558-1.

5. S. K. Siri and M. V Latte, "Universal liver extraction algorithm: an improved Chan–vese model," J. Intell. Syst., vol. 29, no. 1, pp. 237–250, 2020.
6. L. Xu, Y. Zhu, Y. Zhang, and H. Yang, "Liver segmentation based on region growing and level set active contour model with new signed pressure force function," Optik (Stuttg.), vol. 202, no. July 2019, 2020, doi: 10.1016/j.ijleo.2019.163705.

7. N. Satpute, J. Gómez-Luna, and J. Olivares, "Accelerating Chan-Vese model with cross-modality guided contrast enhancement for liver segmentation," Comput. Biol. Med., vol. 124, p. 103930, 2020, doi: https://doi.org/10.1016/j.compbiomed.2020.103930.

8. Y. Li et al., "Liver segmentation from abdominal CT volumes based on level set and sparse shape composition," Comput. Methods Programs Biomed., vol. 195, p. 105533, 2020, doi: https://doi.org/10.1016/j.cmpb.2020.105533.

9. A. Danilov and A. Yurova, "Automated segmentation of abdominal organs from contrast-enhanced computed tomography using analysis of texture features," Int. j. numer. method. biomed. eng., vol. 36, no. 4, pp. 1-14, 2020, doi: 10.1002/cnm.3309.

10. J. Muthuswamy, "Extraction and Classification of Liver Abnormality Based on Neutrosophic and SVM Classifier," in Progress in Advanced Computing and Intelligent Engineering, 2019, pp. 269-279.

11. X. Lu, Q. Xie, Y. Zha, and D. Wang, "Fully automatic liver segmentation combining multi-dimensional graph cut with shape information in 3D CT images," Sci. Rep., vol. 8, no. 1, p. 10700, 2018, doi: 10.1038/s41598-018-28787-y.

12. S. S. Kumar, R. S. Moni, and J. Rajeesh, "Automatic liver and lesion segmentation: A primary step in diagnosis of liver diseases," Signal, Image Video Process., vol. 7, no. 1, pp. 163-172, 2013, doi: 10.1007/s11760-011-0223-y.

13. "DICOM Documentation-Modality Specific Modules." http://dicom.nema.org/medical/dicom/current/output/chhtml/part03/sect_C.8.15.3.10.html (accessed Jan. 20, 2021).

14. "DICOM Documentation - Look Up Tables and Presentation States." http://dicom.nema.org/medical/dicom/current/output/chhtml/part03/sect_C.11.2.html#sect_C.11.2.1.2.1 (accessed Jan. 20, 2021).

15. A. K. Jain, Fundamentals of Digital Image Processing. Prentice Hall, 1989.

16. R. Gonzalez and R. Woods, Digital image processing, 3rd ed. Prentice-Hall, Inc., 2006.

17. P. A. Yushkevich, Y. Gao, and G. Gerig, "ITK-SNAP: An interactive tool for semi-automatic segmentation of multi-modality biomedical images," in 2016 38th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), 2016, pp. 3342-3345.

18. A. A. Taha and A. Hanbury, "Metrics for evaluating 3D medical image segmentation: analysis, selection, and tool," BMC Med. Imaging, vol. 15, p. 29, Aug. 2015, doi: 10.1186/s12880-015-0068-x.

19. V. Yeghiazaryan and I. Voiculescu, "Family of boundary overlap metrics for the evaluation of medical image segmentation," J. Med. imaging (Bellingham, Wash.), vol. 5, no. 1, p. 15006, Jan. 2018, doi: 10.1117/1.JMI.5.1.015006.