## 3 Results and Discussion of Computational Experiments
### Parametrization of the Demons Algorithm  
In order to obtain a set of adequate values for the three parameters of the demon algorithm (see Section 2.2), a heuristic algorithm based on local search is proposed. This algorithm explores multiple values in each parameter's domain and evaluates the algorithm's performance in terms of the similarity coefficients. The local search algorithm is an iterative neighborhood search process. This approach improves the current solution by searching through your environment or neighborhood. Starting with an initial solution, a set of solutions is explored in the environment and the solution is updated if a better one is found. Each implementation of the local search process may differ depending on what is defined as the environment, which determines which solutions are attainable, and which solution is accepted and used to update the current solution. The procedure stops when it fails to improve the solution with the search in the current solution's environment. The current solution in the last iteration of local search is called the local optimal solution. It is important to highlight that the local search process does not guarantee a global optimal solution, given that sections of the feasible region may remain unexplored. In our implementation, the algorithm starts with initial values for each parameter: \(\rho_{0}=200\), \(N_{0}=3\), and \(\sigma_{0}=2.5\). These values are used because initial experiments showed good similarity. The performance evaluation of the solution refers to the highest correlation coefficient obtained in each of the scenarios. It is important to remember that each CT set includes multiple scenarios. Assuming the first scenario as a fixed image, we have a set of moving images (for example, nine moving images for the liver case study). Thus, nine correlation coefficients are obtained, one for each moving image. Then, in order to obtain robust solutions, the highest correlation coefficient obtained in all the scenarios is taken as a measure of performance, so that in the worst case the performance is maximized. The neighborhood of a solution is defined by the solutions obtained after increasing or decreasing the value of \(\delta\) in each variable (a demon algorithm parameter), individually. The values of \(\delta\) depend on the domain of each parameter; thus, the domain for the number  
Figure 4: Converting linear indices 3, 4, 5, and 6 to subscripts of a \(2\times 2\times 2\) matrix. Source: MathWorks. of levels in the smoothing pyramid is \(\rho\in\{1,2,3,4\}\) and \(\delta_{\rho}=1\), the domain for the number of iterations in the first level of the pyramid is \(N\in\{100,200,300,400,500\}\) and \(\delta_{N}=100\), and the domain for the smoothing level for the Gaussian distribution is \(\sigma\in\{0.5,\,0.6,\,...,\,2.9,\,3.0\}\) and \(\delta_{\sigma}=0.1\). When a search in the neighborhood of a current solution generates solutions outside the domain of the parameter values, these solutions are discarded (not evaluated). Additionally, due to the linear complexity of the demon algorithm [12,29], each time a solution is explored, its performance is stored in memory. That way, if a search in the environment of a current solution generates already explored solutions, it is not necessary to repeat its evaluation and therefore speeds up the search process. Table 1 presents a comparison between the initial solution and the local optimal solution obtained with the search process. The first column indicates each of the scenarios for liver CT scans, the second column indicates the correlation coefficient obtained with the initial parameters, and the third column indicates the correlation coefficient obtained with the local optimal parameters using local search. Scenario 1 is used as a control value because it corresponds to the fixed image and therefore its correlation coefficient must always be equal to one. An important result to highlight is that the obtained correlation coefficients are all better than the initial ones for all of the scenarios.