## 2 Materials and Methods
### Tissue Segmentation, Transmittance, and Optical Thickness Estimation  
The first phase of the processing consisted in the segmentation of the image region corresponding to the tissue from the luminal space (or background), and the computation of the average optical thickness of the sample to be used for subsequent signal normalization. The isolation of the tissue was obtained by an automatic single-threshold segmentation of a _mxmx3_ RGB image \(B^{i}\), which was proportional to the \(i\)-th sample transmittance image \(T_{s}^{i}\). \(B^{i}\) was obtained from both parallel and crossed polarized images by using Equations (5) and (6) to compensate for the effects of nonuniform illumination and birefringence. First, the nonuniform illumination was quantified for parallel and crossed configurations by interpolation of the corresponding linearized white images, \(I_{p}^{0}\) and \(I_{c}^{0}\), acquired at the beginning of each microscopy imaging session. The interpolation yielded the _mxmx3_ smooth profiles \(P_{p}^{0}\) and \(P_{c}^{0}\), representing the field illumination cleaned from high frequency noise and acquisition artifacts of the original white images. The interpolation was performed for each channel by least square regression with a base of two-dimensional Legendre polynomials up to order 8. The order of the polynomials was empirically chosen to capture the low-frequency trend of white-image illumination, while removing other artifacts. Legendre polynomials were preferred to the monomial base to avoid numerical overflow and allow convergence of the solver. The image \(B^{i}\), corresponding to the \(i\)-th plate, was then defined for each RGB channel \(k\) by the following equation:  
\[B^{i}_{(k)}=\frac{I_{o(k)}^{i}}{I_{o(k)}^{0}}T_{s(k)}^{i}=\frac{I_{p(k)}^{i}+I_ {c(k)}^{i}}{P_{p}^{0}(k)+P_{c}^{0}(k)} \tag{8}\]  
where the second equality results from applying Equations (5) and (6) on the analyzed images \(I_{p}^{i}\) and \(I_{c}^{i}\) and the white profiles \(P_{p}^{0}\) and \(P_{c}^{0}\) (where \(\delta=0\) and \(T_{s}=1\)). \(I_{o}^{0}\) and \(I_{o}^{i}\) are 1 \(\times\) 3 vectors representing the RGB light intensity for the white and \(i\)-th plate acquisition, respectively. The element-by-element division by the profile matrices corrected the luminance nonuniformity and eliminated the dependence from the polarizer transmitances, so that \(B^{i}\) resulted proportional to \(T_{s}^{i}\) minus variations of light source during the microscopy session. The segmentation of tissue from luminal space relied on a background/foreground separation method based on the histogram shape for each RGB channel of \(B^{i}\). The histogram function \(h(x)\) was reconstructed by binning the intensity values of each channel and applying a Gaussian smoothing kernel. A bin width of 0.001 and a Gaussian sigma of 0.005 were chosen as a compromise between location accuracy and robustness against noise. The analysis took advantage of the bimodal trend of the histogram function, where the first broader peak corresponded to the tissue and the second peak to the background. The threshold was detected in correspondence of the deepest valley between the two peaks of the histogram, as shown in Figure 2. Specifically, for each separating threshold candidate \(t\) in the histogram domain, the maxima \(m_{1}\) and \(m_{2}\) of the left and right histogram sides were detected at intensity values \(x_{1}\) and \(x_{2}\), respectively:  
\[m_{1}=\underset{x<i}{\max}h(x)=h(x_{1})\hskip 14.226378 ptm_{2}=\underset{x\geq i }{\max}h(x)=h(x_{2}) \tag{9}\]  
The optimal segmentation threshold \(t_{seg(k)}\) was determined for each channel \(k=r,g,b\) as the value of \(t\) that maximized the depth function:  
\[d(t)=\min(m_{1},m_{2})-h(t) \tag{10}\]  
with the constraint \(x_{2}\geq 0.8\cdot p_{99}\big{(}B^{i}\big{)}\), where \(p_{99}\) is the 99-th percentile of the distribution.