## 1 Introduction
Moreover, they are less sensitive to noises and blur boundaries because they neglect spatial information about the image. Unlike the intensity-based methods, region-based segmentation schemes [10; 11; 12; 13] consider not only spatial information, but also the relationship between the pixels. To segment the ROI, they identify an initial region and determine the homogeneity between neighbouring pixels. Regrettably, these methods require a proper choice of the initial region and homogeneity criteria for accurate segmentation. Indeed, it is difficult due to the fuzzy nature of the lungs and nodules. Next, several template-based segmentations, for example, genetic-algorithm-based template matching [14; 15] and 3D template matching [16], create template models to detect the target position of the nodules. Nonetheless, template-based methods are computationally intensive and may have flaws for the affine variant of the nodules. With the recent emergence of machine learning techniques, segmentation using machine-learning-algorithms became famous for lung cancer diagnosis. Multi-class pixel-wise segmentation using deep neural networks, such as SegNet [17] and CNN [18], are examples of deep-learning-based segmentation schemes. Due to the use of multiple network layers, these segmentations are in favor of unique feature learning [19]. However, these methods usually consume a massive amount of data and training efforts. Generally, nodules are solitary inside the lungs, but sometimes they may attach to the boundary of the lungs. These nodules are radiologically termed as juxta-pleural nodules. In most cases, such nodules are usually under-segmented since their intensity is substantially similar to the intensity of the lungs. For this reason, a follow-up task, called border reconstruction, is usually performed after the lung segmentation process. Morphological closing, which uses a structuring element (SE) [7; 20; 21], can help to reconstruct the boundary of the lungs. Similarly, a rolling ball algorithm [4; 10], which uses a round-shaped SE, is also a kind of border reconstruction scheme. Instead of using a round-shaped SE, the border reconstruction scheme in [12] used a 45-degree rotated window. However, all these methods have weaknesses in adjusting the optimal size of the SE or window. As the size and shape of the nodules are fuzzy, a small-sized SE or window may cause under-segmentation; conversely, a big-sized SE may cause over-segmentation. Another popular border reconstruction method is the Freeman chain code [5]. This method traces the directional changes of the pixels along the boundary of the segmented lungs. If concave regions along the border are detected, they are assumed to be the boundary-attached nodules and enclosing them will be attempted. The bidirectional chain code in [6] is an improved version of the original Freeman chain code. Unlike the original one, it traces the boundary pixels in both the horizontal and vertical directions using two code-word systems. Compared to other border reconstruction schemes, chain coding algorithms have more of a guarantee to detect variant sizes and shapes of the nodules because they do not depend on the SE or window. Nevertheless, they need extra effort to enclose the concave regions. For example, [6] used SVM to detect the critical point pairs in order to enclose the concave areas along the lung boundary. Since SVM is a supervised learning method, it needs historical data to train the model. As a negative consequence, it may suffer training related problems, such as overfitting and underfitting. An alternative border reconstruction method, known as contour-marching (CM), was proposed in [22]. It corrects the lung boundary by checking the texture features. If a region suspected to be a border-attached nodule is detected, CM encloses that region into the lungs using the region growing method. Indeed, only the texture features are insufficient to distinguish the border-attached nodules.