## 3 Results  
The proposed approach used the public data alone to perform a grid search (i.e., perform an exhaustive search across the various parameter combinations using pre-defined steps to ascertain the optimum combination to lower the average error rate) for \(\sigma_{s}\) and \(\sigma_{t}\) in the range of [20,20] and found the optimal values to be 6 and 5 pixels, respectively (Figure 8). No parameter tuning was performed on the hold-out dataset.  
The averages across all image pairs of the median \(rTRE\) for the affine and the deformable registration were equal to 0.00473 and 0.00279, respectively (Figure 9). Figure 9 indicates the improvements in the \(rTRE\) before applying any registration, after applying only affine registration, and after the proposed approach. Notably, when compared to the other participating methods, the proposed method's (_HistoReg_) score of 0.00279 was the highest score achieved using the public data during the 2019 ANHIR challenge [38] (as indicated in the official challenge webpage: anhir.grand-challenge.org/Workshop-ISBI19/, last accessed: 13 May 2020). It is further noted that the median robustness of the proposed method, as defined by the challenge, was equal to 1 and the average robustness was 0.9898. As shown in Table III of the ANHIR article [38], _HistoReg_'s overall rank during the challenge was 2, on the basis of the median of median \(rTRE\) values (our score was 0.0019). However, it was the best ranked method when the average or the median of average \(rTRE\) (score of 0.0029) values and average robustness (0.9898) were the evaluation criteria. Observed discrepancies between the ANHIR publication [38] and the ANHIR's webpage were attributed to the fact that the challenge organizers allowed submissions to their testing system after the challenge was completed. The overall low \(rTRE\) values contributed towards proving the overall efficacy of the method, with the notable lowest values coming for Gastric tissue slices and the highest values coming from the breast tissue slides, with the median-median \(rTRE\) value going as low as 0.0007, and as high as 0.2, respectively (Figure 10). These results represent the best and worst results in the challenge, respectively. Registrations of consecutive differently stained images from two distinct anatomical sites are illustrated in Figures 11 and 12.  
Figure 8: Heatmap showcasing the average error rate for different combinations of for \(\sigma_{s}\) and \(\sigma_{t}\) (lower is better).  
Figure 10: \(rTE\) values for various tissue types for the evaluation data using the approach proposed.  
Figure 9: The overall median relative target registration error (\(rTE\)) across all public data before any registration, after the affine step, and after both affine and diffeomorphic registration.  
It is also noted that depending on the metric used for the final challenge, ranking the methodological performance of the proposed approaches changed. Importantly, the approach presented in this manuscript remains stable for any ranking criterion [44] defined by the challenge organizers, as evidenced by the statistics presented in [44, 45].  
Finally, the average time needed to compute the registration for a pair of images was equal to 29 s on an Intel Xeon Gold 6130 using eight threads and 32 Gb of RAM. The computation time, which was normalized using the computation time of the evaluation scripts given by the challenge organizers, was equal to 1.45 min.  
Figure 11: (**A**) Four example consecutive differently stained images from a breast tissue case. Different stains include hematoxylin and eosin (H&E), estrogen receptor (ESR), progesterone receptor (PGR), and human epidermal growth factor receptor 2 (ERBB2). (**B**) Example registration results of the source image, registered to the target, resulting in the aligned source. The NCC response maps before and after registration are illustrated in the two right columns.