## 4 Discussion  
The hereby study highlights an approach for performing non-rigid registration of variable-stained histologic whole slide images, agnostic to the anatomical site that the slide is sectioned from. Quantitative evaluation on publicly available data of 10 different dyes applied on tissue types from eight distinct anatomical sites, during a community benchmark, sets our proposed methodology in the top two best performing ones. Notably, the proposed approach is as effective on datasets consisting of sequential tissue sections, as it is on non-sequential tissue sections, an important feature given that clinical cases often consist of non-immediate-sequential sections. This can be considered as the first step in allowing downstream assessment of a 3D volume of digitized slides of clinical tissue specimens. Current routine clinical histopathologic evaluation of disease is based on the microscopic assessment of 2D tissue sample representations. Although 3D tissue evaluation is accepted to offer more contextual information of the disease microenvironment (such as vessel tortuosity), enabling equipment remains part of research laboratories due to associated costs and specialized training. An acceptable schema for evaluating 3D anatomical structure in each dataset is to assess consecutive tissue sections across the \(z\)-axis (depth of tissue within a paraffin block of tissue). This process empowers the evaluation of the anatomic pathology and histology, as well as of characteristics of multiple markers (protein, RNA, and DNA targets) for a patient in a single tissue area across various sequential  
Figure 12: (**A**) Four example consecutive differently stained images from a Gastric mucosa and gastric adenocarcinoma tissue, showing the different stains, namely, CD1A, CD4, CD8, and CD68. (**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. sections. It can further enable a pathologist to extract detailed contextual information about the entire section, and, in particular, enable a better understanding of the spatial arrangement and growth patterns of cells and matrix (vessels, stroma, and immune cells) as it relates to tissues and organs. An automated methodology allowing tissue assessment in 3D, while being able to deal with extreme appearance changes and significant background staining (e.g., DAB stain), without requiring any specialized training, but by virtue of associating consecutive routine clinically acquired whole-slide images, is appealing for richer clinical evaluation of anatomic pathology and histology, as well as of characteristics of multiple markers. Furthermore, such a methodology can contribute to the concepts of accountability, explainability, and transparency in computational systems [46; 47], as it can assist a clinical pathologist to better understand the spatial arrangement and growth patterns of cells and matrix (vessels, stroma, and immune cells) but also offer a deeper insight for downstream research analysis of specific disease. This study showed that a general-purpose tool originally developed for registration of 3D radiographic images, such as magnetic resonance imaging (MRI), can achieve excellent performance in the domain of histology registration. _Greedy_ has previously been used for histology-MRI matching [43], and no major algorithmic developments were needed to adopt it to this task and challenge. The proposed approach does not require any specialized hardware (i.e., GPU) as it is CPU-based and achieves relatively low computation time by using highly optimized code for similarity metric computations. The code related to the package (including pre-processing) is available through our GitHub page at github.com/CBICA/HistoReg (accessed: 11 February 2021).