## 2 Materials and Methods
### Proof of Concept Application of the Framework to Cardiac Histological Sections  
As a proof-of-concept application, the analysis framework was applied to a database of bright-field/dark-field images of picrosirius red-stained atrial tissue sections, obtained in a group of 14 patients (age 69.1 \(\pm\) 10.1 years, 3 female), who underwent a cardiac surgery intervention. The investigation was approved by the Ethical Committee for Clinical Experimentation of the Provincial Agency for Health Services of the Autonomous Province of Trento (N.6/2012) and confirmed to the principles outlined in the declaration of Helsinki. All patients gave written informed consent. In each subject, atrial specimens of few mm\({}^{2}\) area were excised from the right atrial appendage during heart cannulation for extracorporeal circulation (surgical waste) and embedded in paraffine. Epicardial and endocardial surfaces were identified, and the outmost and innermost layers (-200 um) of the samples were removed. 15 longitudinal sections of -5 um thickness were cut, in each patient, along the mid-wall using a rotary microtome (Leica RM2245; Leica Biosystems, Milan, Italy). Tissue sections were stained with 0.1% solution of Sirius Red F3 BA (Direct Red 80, CI 35780; Sigma Aldrich, Milan, Italy) according to previously reported protocols [7], and mounted with a drop of mounting medium and a glass cover slip. Picrosirius red-stained sections were examined by light microscopy (DMIL microscope combined with DFC420 camera, Leica, Germany; 4\(\times\) magnification, 0.1 numerical aperture). Images were acquired using a LP-S-LP setup, both in parallel (bright-field) and crossed (dark-field) filter configurations. For each tissue section, a single field (3.6 \(\times\) 2.7 mm\({}^{2}\)) was randomly selected within the entire tissue area and acquired in both modalities, resulting in 15 bright-field and 15 dark-field images in each patient. A total of 420 images (210 in bright-field and 210 in dark-field) were acquired from the overall population and submitted to the proposed analysis framework. Information about the microscopy camera acquisition setting was obtained from the metadata of the image files. The exposure times were chosen in each session to obtain an optimal dynamic range and to avoid overexposure. The exposure times were 6.0 \(\pm\) 0.9 [3.3-6.8] ms and 114.3 \(\pm\) 12.7 [94.5-139.4] ms for the bright (\(t_{p}\)) and dark-field images (\(t_{c}\)), respectively. Gamma encoding was \(\gamma\) = 1. Original images had a resolution of 2592 \(\times\) 1944 pixels, with a pixel size of 1.39 \(\upmu\)m, and were subsequently downsized to 1296 \(\times\) 972 pixels by 2 \(\times\) 2 pixel binning for further processing. Before performing the overall analysis, the common threshold \(t_{col}\) for collagen segmentation was determined based on the analysis of a subset of 56 images (2 sections per patient, yielding 28 bright-field and 28 dark-field images in the overall population). In each \(S_{col}^{i}\) image of the subset, the threshold value to identify collagen was manually defined by an expert biologist based on visual inspection. The appropriateness of high-collagen region segmentation was evaluated by the operator by comparing it with both the stained illumination-corrected bright-field image and the processed dark-field image and considering the visual appearance of myocardial fibrosis patterns. To avoid any prior-knowledge bias among the subsequent analysis of images, images were anonymized and randomized, with each selection blind with respect to the threshold numerical value. The common threshold \(t_{col}\) was defined as the average of the threshold values. The range of threshold values assigned during the procedure was used for the sensitivity analysis described at the end of this Section. The capability of the analysis framework to point out fibrotic content differences associated with the presence of different cardiac conditions was tested.