Lung Segmentation in CT Scans for Lung Nodule and Cancer Detection

Noor Khehrah1, Saira Bilal2, Muhammad Shahid Farid1

1Punjab University College of Information Technology, University of the Punjab, Lahore

2Assistant Professor of Radiology, General Hospital, Lahore



Cancer is difficult to diagnose because of its complexity. It is a heterogeneous disease which adds to the difficulty of diagnosis and prognosis. Lung cancer is among the most inflicting type of cancer. It has high incident rate and high mortality rate as it is often diagnosed at the later stages when it is challenging to treat it. Therefore, a significant research effort is being done to help the oncologists in early lung cancer diagnosis and treatment.


Computed Tomography Scan (CT Scans) are widely used to detect the disease; it helps to visualize small nodules or tumors which cannot be seen with a plain film X-ray. Computer Aided Devices (CAD) are being developed to diagnose the disease at earlier stages efficiently. The preliminary stage of lung cancer diagnosis via CAD is lung segmentation from the chest CT scans. It is considered a fundamental activity in these systems as their performance usually depend on the segmentation accuracy.

Our Contribution

In this paper, we propose a lung segmentation algorithm. The algorithm utilizes morphological image processing techniques to efficiently segment the lungs from the chest CT scans.

Brief Methodology

The proposed algorithm works in four steps: in the first step, the preprocessing the CT scan images is performed, which includes the conversion of DICOM images into a loss aversion format i.e. PNG. In the second step, a histogram of the gray scale image is constructed to automatically estimate the threshold to separate the lung region from the background. In the third step, the connected components are computed to remove the any remaining background. In the final step, the morphological operator dilation is used to improve the segmentation.

Experiments and Results

The performance of the proposed algorithm is evaluated on a large dataset of chest CT scan images. The results show that the proposed algorithm is able to effectively segment the lungs from CT scans.