• No results found

4.2 Methodology

4.2.4 Superpixel Segmentation

Superpixel segmentation partitions the image into flexible patches with approximately similar size and intensity values. The simple linear iterative clustering (SLIC) (Achanta et al., 2012) method is used in the proposed SP_ERT method. The reason for selection of SLIC is that it has few parameters that are flexibly tuned. Hence, the trade-off between those parameters and boundary adherence can be controlled. The SLIC method is also computationally and memory efficient. The initial stage of the SLIC superpixel segmentation is gridding the natural colour image into equally sized arbitrary patches such as rectangles or squares. In the case of MRI FLAIR images, the initial grids are generated for each slice separately. In (Achanta et al., 2012), it is suggested to use squares as the initial SP grid for natural images. The reason for this assumption is that the aspect ratio of the pixel dimensions in natural images is equal to 1, which means that the height and width of each pixel is the same. The MR images of the brain have identical voxel dimensions in the X and Y directions in each slice. Therefore, the initial grids are considered as squares with the side size of S. The geometrical centre of each initial segment is considered as the superpixel centre which are then updated in every further iteration. Figure 4-5 illustrates the changes in the superpixel configuration in the iterations, from the initial to the final SP.

65

Figure 4-5 Clustering the homogenous pixels to one SP, initialling from a regular grid to the final homogenous superpixel. It should be noted that the centre of the SP may change in each iteration.

The pixels are clustered based on their spatial and intensity distance metrics. The spatial distance, ds, between the ith and jth pixel is obtained using:

𝑑𝑠 = √(π‘₯π‘—βˆ’ π‘₯𝑖)2 +(π‘¦π‘—βˆ’ 𝑦𝑖)2 (4-1)

where, x and y are the pixel location coordinates. The intensity distance dc between the two

pixels is defined as:

𝑑𝑐 = √(πΌπ‘—βˆ’ 𝐼𝑖) 2

(4-2) where, Ii and Ij are the normalized intensity values of the ith and the jth pixel, respectively.

The overall distance measure D is the combination of the spatial and intensity distances. It is calculated using: 𝐷 = βˆšπ‘‘π‘2+ ( 𝑑𝑠 𝑆) 2 π‘š2 (4-3)

where, m is the compactness coefficient which determines the flexibility of superpixel boundaries. A higher value of m increases the effect of spatial distance therefore results in more compact segments. A lower value decreases the effect of spatial distance and creates more flexible boundaries.

66

Figure 4-6 shows an illustration of the distance calculation for SP segmentation. The distances are calculated for a desired pixel, Pi, in order to assign the cluster label to that pixel. The search

area is restricted around Pi, which is represented as the dashed square.

The way how compactness factor, m, affects the total distance, D (Equation (4-3)), and therefore the SP boundaries, depends on the image intensity values (which determine dc). The

SP method proposed in (Achanta et al., 2012) is optimised for natural images with the CIELAB colour space. The compactness factor in the range [1,40] is suggested for this type of images. MRI images have a various range of intensity values, which depend on the tissue and the image acquisition parameters. Therefore, it is difficult to set a generic range with the raw FLAIR voxel intensities. For this reason, the MRI image intensities used in Equation 2 are normalized to the values of [0, 1] to ensure that both the intensity and spatial distances are within the same range. This is also important in the optimisation process when a universal range or value of

m will be suggested which is applicable to all the new FLAIR images. SP segmentation with different compactness factors is shown in Figure 4-7 for a MR image acquired with the FLAIR protocol containing a Grade II tumour.

Figure 4-6 Illustration of distance in the SLIC-based superpixel algorithm. SPi presents the

superpixel, Ci the SP centre and Dpi,Cj the distance between the desired pixel and the SP centres

67

a b

c d

Figure 4-7 Superpixel segmentation for one slice of the MRI image different compactness factors: a) original MRI FLAIR image with a Grade II tumour, b) superpixel segmentation with m = 0 and S = 10, c) superpixel segmentation with m = 0.2 and S = 10, d) superpixel segmentation with m = 0.5 and S = 10.

a

b

c

Figure 4-8 Superpixel segmentation for one slice of the MRI image with different window sizes: a) original MRI FLAIR image with a Grade II tumour, b) superpixel segmentation with

S = 10 (initial grids 10 x 10) and m = 0.2, c) superpixel segmentation with S = 20 (initial grids 20 x 20) and m = 0.2.

Figure 4-8 shows the same image in Figure 4-7, which is partitioned separately to superpixels with two different side sizes, S. In Figure 4-8(b) and Figure 4-8(c), the superpixels are

68

extracted with S = 10 and S = 20, respectively. The compactness factor is fixed to m = 0.2 for both sizes to show only the effect of size parameter. A good partitioning occurs when the segmented regions include homogenous pixels, while the superpixel boundaries adhere to the edges in the image.

At the end of superpixel segmentation, some isolated pixels might appear. The label of these pixels is different from their surrounding pixels, which is considered as the noise of the superpixels. A post-processing procedure is designed to reduce the isolated pixels. The label of the pixels connected to the isolated pixels are counted. Then the isolated pixel is relabelled to the major connected class.