# Segmentation of Meristem Cells by an Automated Optimization Algorithm
## 2 Materials and Methods
### Overview of the Parametric Segmenting Tuning Technique (PST)
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Index** & **Definition** & **Mathematical Expression** \\ \hline \multirow{4}{*}{Sensitivity} & It represents a relationship between the True Positive & \\  & Rate (TPR) and the False Positive Rate (FPR). It varies & \\  & between zero and one, being minimal when the FPR is & \\  & zero and maximum when the TPR is one. & \\  & It compares the reference and segmented sets \(\alpha\) and \(\beta\), & \\  & measuring the one-to-one correspondence between the & \\  & pixels of both sets. & \\  & Minimum distance in the ROC space between the & \\  & optimum segmentation point (0.1) and the one located in & \\  & (FPR, TPR). & \\  & It measures how well two sets of points of the compared & \\  & images \(\alpha\) and \(\beta\) match each other. It varies between 0 & \\  & and 1, being zero if the sets of points are orthogonal and & \\  & one if they coincide, i.e. they are collinear. & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Definition of the similarity and distance indices used for tuning the Parametric Segmentation Tuning (PST). Figure 5: Space of solutions. The segmentation solutions space is three-dimensional, where each coordinate is a segmentation parameter (\(B\), \(h\), \(d\)) and each space element is a binary image of size \(u\). Each triplet of coordinates is used to generate a \(u\)-size binary image. neighbor images \(I_{n}=T\big{(}I,\overrightarrow{p}_{n}\big{)}\) and \(I_{n-1}=T\big{(}I,\overrightarrow{p}_{n-1}\big{)}\). These images are the result of the segmentation algorithm \(T\big{(}I,\overrightarrow{p}\big{)}\) explained in Section 2.1. Since there are three parameters to be tuned, the PST Algorithm 1 can be implemented with the following pseudo-code:  
```
1:Input: \(I\) original image
2:Output: optimal segmented image
3:\(I_{n}\): Image segmented in step \(n\)
4:\(B,\ h,\ d\) Parameters to be tuned
5:\(B^{*}\), \(h^{*}\), \(d^{*}\) Optimal parameters
6:\(n=1\)
7:\(I_{n-1}=\ White\_Image\)
8:for\((B=B_{min}\ ;B\leq\ B_{max}\ B++)\)
9:\(for\ (h=h_{min}\ ;h\leq\ h_{max}\ h++)\)
10:\(for\ (d=d_{min}\ ;d\leq\ d_{max}\ h++)\)
11:\(\{\)
12:\(I_{n}=\ segmentation\ (B,\ h,\ d)\)
13:\(if\ (\psi(I_{n},I_{n-1})\) is optimum) then \(B^{*}=B\), \(h^{*}=h\), \(d^{*}=d\)
14:\(previous\ I_{n-1}=I_{n}\)
15:\(\}\)
16:Optimal\_Image\(=segmentation\ (B^{*},\ h^{*},\ d^{*})\)
```  
**Algorithm 1** Parametric Segmenting Tuning Technique (PST)  
This algorithm is slow, but it allows finding the optimal segmentation parameters. It is possible to build more efficient algorithms to obtain the best parameters, although this objective is beyond the scope of this work. However, a faster method to get the approximate parameters consisted in sweeping one parameter (\(B\)), while the other two remain fixed until finding the value (\(B\)) that allows obtaining the best index. Then, another parameter (\(h\)) is swept, while the other two remain fixed (\(B\) with the best value found) looking also for the best value. This process is applied to all three parameters. This approach is much faster and was used to find the optimal values of the segmentation method. Figure 6: Flowchart of the tuning technique.