In this section, the proposed kidney segmentation method with a hierarchical strategy will be presented in detail. The hybrid method which incorporates SKFCM and IGC algorithm mainly consists of four steps. The framework of the proposed method is shown in Figure 1.
A. Preprocessing
CT image has inhomogeneity, noise which affect the continuity and accuracy of the images segmentation. Therefore, a 3 × 3 median filter is used to reduce the noise. The equation of median filter is defined as:
(1)
where S represents the template window with a 3 × 3 surrounding neighborhood, represents the intensity value of each pixel in the S, represents the middle value of all the values of the pixels in the neighborhood. Instead of simply replacing the pixel value with the mean of neighboring pixel values, median filter replaces it with the median of those values. Figure 2(a) is the original image. Figure 2(b) is the denoised image by a median filter. It has a better denoising result while the edges are well preserved.
B. Rough Segmentation with SKFCM
In this paper, SKFCM algorithm introduces a kernel function and spatial constraint into the FCM algorithm, which can reduce the effect of noise and improve the clustering ability. The objective function of SKFCM as follows,
(2)
where c is the number of clusters of the dataset , n is the number of pixels, m is a weighting exponent on each fuzzy membership and determines the amount of fuzziness of the resulting classification, are the centers and the array represents a partition matrix, α in the second term controls the effect of the penalty, is the mean of neighboring pixel values of , is the Gaussian kernel function. The objective function in (2) is minimized using the alternate iterations of the fuzzy partition matrix (3) and the centroids of clusters (4).
(3)
(4)
The above algorithm can be summarized in the following steps.
Step 1: Fix the number c of these centroids and select initial class centroids and set to a very small value.
Step 2: Compute the mean filtered image.
Step 3: Update the partition matrix using (3).
Step 4: Update the centroids using (4)
Repeat steps 3-4 until the following termination criterion (5) is satisfied:
The purpose of this subsection is to get the rough contour of kidney in the CT images. Owing to the gray scales of kidney is similar to its neighboring tissues, it is important to identify which part belongs to the kidney. To solve this problem, a slice which has the largest contour in the whole dataset is cropped by a rectangle manually. The rectangle must enclose the kidney and its size should be as small as possible, so that it can increase the processing speed and the segmentation accuracy. Other slices are automatically cropped as described in the following. The optimal cluster number is 4 which is determined by experiments. The rough segmentation includes six steps.
Step 1: The cropped image is the input of SKFCM algorithm, and then each pixel in the cropped region is clustered into different clusters.
Step 2: The number of pixels in each cluster is calculated and the cluster which contains maximum pixels is extracted.
Step 3: The largest connected region is extracted to be the candidate kidney region.
Step 4: There are some holes inside the kidney because some vessels are rejected in the processing of fuzzy clustering. Therefore this step is to fill holes.
Step 5: The kidney contour is smoothed by morphological operations.
Step 6: Through the above steps, the mask of candidate kidney region is gotten. In order to realize the continuous segmentation, the minimum bounding rectangle (MBR) of the mask is calculated. Then the MBR is extended about 10 pixels so that we can get a new rectangle. This new rectangle is used to crop the next slice of CT sequeces.
Continuous rough kidney segmentation on CT images can be achieved by repeating steps 1-6. The procedure of rough segmentation is shown in Figure 3.
Figure 4 shows some intermediate results of rough segmentation. Figure 4(a) and 4(g) are original images, and the red rectangles are used to crop these original images. Figure 4(b) and 4(h) are clustering results. Figure 4(c) and 4(i) are the clusters which contain maximum pixels. Figure 4(d) and 4(j) are the largest connective regions with filled holes. Figure 4(e) and 4(k) are the candidate kidney with smooth contour. Figure 4(f) and 4(l) are the final results of SKFCM. The red rectangle is generated automatically and used to crop the next slice of CT images. As shown in the figures, Figure 4(f) is a better segmentation result than Figure 4(l). The former does not need refined segmentation, but the later need further segmentation by IGC algorithm. In the whole datasets, there are about half of images do not need refined segmentation after rough segmentation. More results of rough segmentation were shown in Figure 5. The parameter n is the slice number in the whole datasets.
C. Refined Segmentation with IGC Algorithm
1) The traditional GrowCut
GrowCut algorithm is an interactive segmentation method and solves pixel labeling task based on cellular automaton.
A cellular automaton (CA) is defined as a triplet , where S is a set of non-empty state, N is the neighborhood system and defines the state transition rule of cells at time t+1 based on the states of neighbor cells at time t. The Moore von (8-connected) and Neumann (4-connected) neighborhoods are two commonly used neighbor systems. The state of each cell is also a tri-plet , where is the label of this cell, is the strength of this cell which ranges from 0 to 1, and is the feature vector that its value is image intensity.
A two-dimensional medical image (P) is a matrix of m×n pixels, and it is also treated as a cellular automaton with a special state in GrowCut algorithm. Each pixel (p) in the image is a "cell" with a certain type, and it may be background, foreground or undefined. The initial state for is set to
(6)
where is the intensity value of each pixel. As the segmentation algorithm proceeds, all pixels in this image are assigned to one of possible labels.
Before starting the segmentation, user should input an initial label matrix manually. The label matrix has a same size with the original image. In the label matrix, there are two kinds of marked points, one is foreground seed point whose label is , and the other is background seed point whose label is . The original strength of these two kinds of marked points is . Apart from these two kinds of marked points, the label of the remainder of points is . After all the initial operations have been done, the iteration segmentation runs until the label matrix does not change. Finally, the label value of object region is 1 and the label value of background is -1. The iterative process of labels and strength at time t+1 is shown as follows,
State transition of CA
// For each cell...
for
// Copy the previous state
;
;
// Neighbors try to attack current cell
for
if
;
;
end if
end for
end for
In [18], g(x) is defined as:
(7)
2) The Improved GrowCut
Although GrowCut algorithm is simple and precise, it is an interactive segmentation algorithm. For some complex images, just once interactive operation cannot achieve satisfactory results, and both foreground seed points and background seed points also should be selected carefully. In order to avoid multi-interaction, we propose an improved GrowCut algorithm which can generate seed labels automatically.
In this subsection, the rough segmentation results are continuous in space series and about half of them do not need refined segmentation. Therefore, the initial label matrix can be generated automatically using the result of rough segmentation (denoted as "a seed template image"). The seed template image must meet two conditions. One is that it does not need refined segmentation, and the other is that it is adjacent to the slice which needs refined segmentation. The process of generating both foreground and background seed points is described in Figure 6. Figure 6(a) is an original kidney CT image and Figure 6(d) is the contour of the kidney. Due to the spatial continuity of CT images, Figure 6(d) can be used to generate the initial label matrix for the segmentation of next slice. There are four steps to generate the initial label matrix automatically.
Firstly, we should get the edge points of kidney contour.
Secondly, calculate the altitude difference between two edge points. Figure 6(b) and 6(c) show the altitude difference (dy) at point Pm and Pn respectively.
Thirdly, there are three threshold values Th, T1, T2 to control the process of generating seed points. The seed points will be located in the vertical direction if dy is less than Th, otherwise they will be located in the horizontal direction. Taking Figure 6(e) as an example, the foreground seed point is located at the bottom of Pm and the background seed point is located at the top of Pm , because dy is less than Th. In Figure 6(f), the foreground seed point is located at the right of Pn and the background seed point is located at the left of Pn, because dy is greater than Th. All foreground seed points are located inside of the kidney contour and the distance between them and edge points are T1 pixel. All background seed points are located outside of the kidney contour and the distance between them and edge points are T2 pixel. In Figure 6(e) and 6(f), the red points are denoted as foreground seed points and the green points are denoted as background seed points.
Finally, according to step 2 and 3, we can get both foreground and background seed points of each edge point
Figure 7 shows the refined segmentation result by IGC algorithm. Figure 7(a) is a seed template image. Figure 7(b) is the seed label image which is generated automatically base on IGC algorithm. The red points are foreground seed points and the green points are background seed points. The value of red point is 1, the value of green point is -1, and the remainders are 0. The final result of IGC is shown in Figure 7(c). More refined segmentation results are shown in Figure 8. They have the same slice number with the rough segmentation results in Figure 5.
D. Post-processing
Some segmentation results of IGC and SKFCM have rough boundaries. To achieve a smoother contour of kidney, a post-processing method based on morphological operations is needed. The most common morphological operations are dilation and erosion.