## 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)
The value for this parameter can be varied, so it will be considered in the parametric study described in Section 2.6. Hereinafter this parameter will be called \(c_{-}gelpad\). \(I\) is the image. \(g(I)\) is the stopping function. The stopping function is given by the following Equation:  
\[g(I)=\frac{1}{1+\left|\
abla I\right|^{p}} \tag{3}\]  
where:  
\(\hat{I}\) is the smoothed version of the image \(I\) using a Gaussian filter. The filter size and its standard deviation \(\sigma\) are fixed values and they were set to \(5\times 5\) and \(1\) respectively. \(p\) is an exponent with a fixed value of 2. The implementation for the GAC method used in the current study, and the values of its fixed parameters, are based on the implementation reported in [9]. The DRLSE method [8] is defined as follows  
\[\frac{\partial\phi}{\partial t}=\mu\text{div}\left(d_{p}\left(\left|\
abla\phi \right|\right)\
abla\phi\right)+\ \lambda\delta_{\varepsilon}(\phi)\text{div}\left(g\frac{\
abla\phi}{|\
abla \phi|}\right)+\alpha g\delta_{\varepsilon}(\phi) \tag{4}\]  
where:  
\(\phi\) is the level set function. The initial form of this contour is the initial contour, denoted as \(\phi_{0}\). Its shape can be varied, so it will be considered in the parametric study described in Section 2.6. Hereinafter this parameter will be called \(phi_{-}0\). \(\mu\) is the coefficient of the distance regularization term. For this parameter, a fixed value of 0.2 was considered. \(\lambda\) is the coefficient of the weighted length term. For this parameter, a fixed value of 5 was considered. \(g\) is the edge indicator function. \(\alpha\) is the weighted area coefficient. The value for this parameter can be varied, so it will be considered in the parametric study described in Section 2.6. Hereinafter this parameter will be called \(a_{-}gelpad\). \(\delta_{\varepsilon}\) is the Dirac delta approximation function. \(d_{p}\) is a function in terms of potential function. The edge indicator function \(g\) is defined as  
\[g\triangleq\frac{1}{1+|\
abla G_{o}*I|^{2}} \tag{5}\]  
where:\(G_{\sigma}\) is a Gaussian kernel with standard deviation \(\sigma\). The filter size and its standard deviation \(\sigma\) are fixed values and they were set to \(5\times 5\) and \(1\), respectively. The values of these parameters were chosen to be the same as those of the stopping function in the implementation of the GAC method. \(I\) is the image. The Dirac delta approximation function \(\delta_{\varepsilon}\) is defined as  
\[\delta_{\varepsilon}=\left\{ \begin{array}{ll}\frac{1}{2\varepsilon}\big{[}1 +\cos\bigl{(}\frac{\pi\pi}{\varepsilon}\bigr{)}\big{]},&|x|\leq\varepsilon\\ 0,&|x|>\varepsilon\end{array} \right. \tag{6}\]  
where:  
\(\varepsilon\) is a parameter with a fixed value of \(1.5\). \(d_{p}\) is a function in terms of potential function defined as  
\[d_{p}(s)\triangleq\frac{p^{\prime}(s)}{s} \tag{7}\]  
where:  
\(s\) is the magnitude of the gradient of the level set function \(\phi\) defined as  
\[s=\sqrt{\left(\frac{\partial\phi}{\partial x}\right)^{2}+\left(\frac{\partial \phi}{\partial y}\right)^{2}} \tag{8}\]  
\(p(s)\) is the double-well potential function defined as  
\[p(s)=\left\{ \begin{array}{ll}\frac{1}{(2\pi)^{2}}\big{[}1-\cos(2\pi s)\big{]},&s\leq 1\\ \frac{1}{2}\big{(}s-1\big{)}^{2},&s>1\end{array} \right. \tag{9}\]  
The implementation for the DRLSE method used in the current study and the values of its fixed parameters are based on the implementation reported in [10]. For the gel-pad detection, both the GAC and DRLSE methods require an initial contour that is based on the calculation of the maximum rectangle inside an arbitrary shape defined by a binary image [11]. The algorithm used in the current study is a MATLAB(r) (2017 MathWorks, Inc., Natick, MA, USA) implementation that works with a binary input image \(I(x,y)\), shown in Figure 7c, the specification of an optimization criteria and the minimum dimensions to restrict the calculation.