## 2 Materials and Methods
### Image Segmentation Methods for the Identification of Regions of Interest
#### 2.4.1 Image Segmentation with Threshold and Level Set Methods (TLSM)
Finally, the algorithm yields a binary image \(M(x,y)\) with the mask of the maximum rectangle inside the arbitrary shape. The obtained maximum rectangle is shown in Figure 8a. The initial contour, \(u\_0\) for the GAC method and \(phi\_0\) for the DRLSE method, was a reduced version of the maximum rectangle and its dimensions can be varied, so it will be considered in the parametric study described in Section 2.6. An example of one of the reduced versions is shown in Figure 8b. In both the GAC and DRLSE methods, the initial contour changes its shape iteratively, and the algorithm stops at the detected borders. The final contour has the shape of the found object as shown in Figure 8c. The segmentation of the gel-pad region, together with the previous segmentation of the air region, gives an enclosed region corresponding to the tissue region. The resulting segmented image is shown in Figure 8d. The reduced version of the maximum rectangle consisted of a fixed reduction of its width by five pixels from the right and left sides, and a variable reduction of its height from the lower side by \(25\) to \(32\) pixels. Hereinafter, the set of the different reduced versions of the maximum rectangle will be called \(W-i\), where \(i\in\mathbb{Z}:i\in[25,32]\) is the number of pixels used for the reduction. Another set of reduced versions was also considered in the parametric study described in Section 2.6. This set has the same characteristics of the previous set and, in addition, features a displacement of five pixels from the upper side. Hereinafter, this set will be called \(W_{d}-i\), where \(i\in\mathbb{Z}:i\in[25,32]\). Another approach for the generation of the initial contour was explored. An initial contour based on the edge indicator function of Equation (5) was generated. The process is shown in Figure 9 and was carried out as follows: The edge indicator function was applied to the upper part of the original MR image shown in Figure 9a. The result is shown in Figure 9b. A threshold of 0.2 in a grayscale of 256 levels between 0 and 1 was applied to obtain the image shown in Figure 9c. A mask from the image shown in Figure 9c was obtained using the RGA with a seed point in (3,3). The complement of the resulting image was calculated, and the result is shown in Figure 9d. The image shown in Figure 9c was multiplied by this image to limit the number of areas. The result is shown in Figure 9e where the larger area corresponds to the gel-pad region. The centroid of this large area is shown as a red spot. The gel pad area was then extracted using the RGA with the centroid as the seed point. The extracted region is shown in Figure 9f, and it was used as a mask for the extraction of the corresponding region in the original MR image shown in Figure 9a. The result is shown in Figure 9g. The initial contour was obtained after the application of a threshold of 0 in a grayscale of 256 levels between 0 and 255, in the image shown in Figure 9g. In Figure 9h the initial contour is shown superimposed in the original MR image. This approach for the initial contour (hereinafter this approach will be called the automatic initial contour) was used by both the GAC and DRLSE methods to obtain a final contour with the shape of the found gel-pad region as shown in Figure 9i. The segmentation of the gel-pad region, together with the previous segmentation of the air region, gives an enclosed region corresponding to the tissue region. The resulting segmented image is shown in Figure 9j. Figure 8: Segmentation of Gel-Pad Region: (**a**) Maximum rectangle within the region; (**b**) An example of initial contour (in this case the initial contour \(W-25\)); (**c**) Final contour; (**d**) Segmented MR Image (upper part).