The purpose of spectral transformation is to convert the original or enhanced transmittance of a tissue component to the spectral configuration associated to its reaction to a particular stain. In our work, the spectral transformation was achieved by designing an $N\xd7N$ transformation matrix $Q$ using the enhanced H&E and Masson’s trichrome stained spectral samples of the different tissue components by least mean squares method, Eq. (16). The spectral samples represent seven different classes of tissue components. To minimize the effect of intra-class spectral variations, the spectral average of each class, e.g., nuclei, cytoplasm, etc., was instead considered to find the solution for $Q$.^{10} Taking this into consideration, Eq. (16) reduces to the following form: Display Formula
$[tt(1,1)tt(1,2)\u2026tt(1,N)tt(2,1)tt(2,2)\u2026tt(2,N)\vdots \vdots \ddots \vdots tt(c,1)tt(c,2)\u2026tt(c,N)]=[te(1,1)te(1,2)\u2026te(1,N)te(2,1)te(2,2)\u2026te(2,N)\vdots \vdots \ddots \vdots te(c,1)te(c,2)\u2026te(c,N)][QN\xd7N],$(22)
where $tt(c,1)$ and $te(c,1)$ are the average transmittance of the $c\u2032$th class at band $i=1,2,\u2026,N$ of the Masson’s trichrome and the H&E enhanced spectral transmittance samples. The $N\xd7N$ matrix $Q$ was then derived using the Pseudoinverse function as implemented by Matlab.^{21}