A Model based Survey of Colour Deconvolution in Diagnostic Brightfield Microscopy: Error Estimation and Spectral Consideration

Colour deconvolution is a method used in diagnostic brightfield microscopy to transform colour images of multiple stained biological samples into images representing the stain concentrations. It is applied by decomposing the absorbance values of stain mixtures into absorbance values of single stains. The method assumes a linear relation between stain concentration and absorbance, which is only valid under monochromatic conditions. Diagnostic applications, in turn, are often performed under polychromatic conditions, for which an accurate deconvolution result cannot be achieved. To show this, we establish a mathematical model to calculate non-monochromatic absorbance values based on imaging equipment typically used in histology and use this simulated data as the ground truth to evaluate the accuracy of colour deconvolution. We show the non-linear characteristics of the absorbance formation and demonstrate how it leads to significant deconvolution errors. In particular, our calculations reveal that polychromatic illumination causes 10-times higher deconvolution errors than sequential monochromatic LED illumination. In conclusion, our model can be used for a quantitative assessment of system components - and also to assess and compare colour deconvolution methods.


S1.1: Theory of Absorption, Absorbance and Deconvolution
Degression of intensity of radiation I(λ) passing through transparent materials is a function of material properties α(λ), wavelength λ and layer thickness s and it is proportional to the radiation intensity. Mathematically it can be described by: The resulting exponential degression of the intensity I(λ) is formulated in the Bouguer-Lambert-Beer equation:  (S9) With the definition of the spectral absorbance A(λ) as negative logarithm of the relative intensity I(λ)/I 0 (λ), the linear relation between the absorbance of multiple stains and the concentrations of the pure stains follows:  (S10) solve Eqn. (S15). In this case the results c 1 and c 2 are free of dimension and can -without normalizing the stain vectorsbe interpreted as multiples of the concentrations of the pure stains c 1p and c 2p . This can be seen by rewriting Eqn. (S13) and (S14) The stain vectors ip A specify the target system for the linear coordinate transformation. They are given by the measured transmission of pure stained reference samples, for example for two monochromatic wavelengths in form of: Of note, stain vectors ip A have to be called more precisely relative stain vectors since their length depend on the concentration of the pure stains present in the reference samples.
For a mixture of three stains with the concentrations cˈ 1 , cˈ 2 and cˈ 3 the Eqn. (S24) and (S25) can be extended for three monochromatic wavelengths k, l and m:  The direction of such a stain vector is independent from the absolute concentration of the pure stain, since for any concentration c the spectral transmittance τ(λ) can be expressed by the relative concentration cˈ. cˈ is a constant factor to all vector components due to the logarithmic definition of the absorbance. This can be seen for a 2-dimensional stain vector: This is interesting when normalized stain vectors with a unit length of 1 are used for deconvolution. Even though the vector direction is not influenced by this normalization, the deconvolution results c * 1 and c * 2 obtained with those normalized vectors cannot be directly compared to results cˈ 1 and cˈ 2 obtained with non-normalized stain vectors. The ratios of those concentrations are different: Since the normalization of stain vectors is a scaling of the axis of the vector plane, the results -obtained with normalized and non-normalized vectors -can simply be converted by diving the concentrations c * 1 and c * 2 by the vectors original length: Therefore, deconvolution results based on normalized and non-normalized stain vectors are equivalent but not identical.
The linear deconvolution of absorbance values determined from intensity values measured at monochromatic wavelengths delivers bijective results and -without considering effects such as signal background, system non-linearity, stain variability and aberrance from Lambert-Beer assumption -error free measurements.

RGB Camera Signals -Stain Vectors
In some applications the deconvolution method is applied to image values from non-monochromatic devices such as RGB colour cameras. Doing so, the assumption is made that the absorbance values of red, green and blue spectral bands A R , A G , A B can be calculated as negative logarithms of the ratio of RGB colour channel values V R , V G , V B and maximum channel values V 0R , V 0G , V 0B . For an 8bit camera this assumption can -without considering signal background, noise effects, white balancing etc. -be written as: Because of the non-monochromatic and therefore non-linear formation of the camera values, it is questionable if the linear relation of absorbance and stain concentration from Eqn. (S10) is valid for these absorbance values A R , A G , A B .
To address this question, we simulate the formation of camera signals. Our model comprises the spectral sensitivity functions s R (λ), s G (λ), s B (λ) of a scientific grade CCD camera, the spectral intensity distribution of the illumination I 0 (λ) and the spectral transmittance τ p (λ) of pure stains.
We describe the formation of the camera values for a pure stain by the integral equations: (Commonly for the visible wavelength region: λ 1 = 380 nm, λ 2 = 780 nm.) (In the following we assume k R_CCD = k G_CCD = k B_CCD = 1/[meter].) Based on these equations the absorbance values A R , A G , A B of a pure stain can be modelled by: According to this model, the absorbance values A R , A G , A B are not linearly related to the stain concentration as in the monochromatic case. The relative concentration cˈ, as exponentiation of the spectral transmittance τ p (λ), is no longer a constant factor to the vector components. This implicates that (i) the direction of stain vectors derived from those absorbance values depends on the stain concentration and (ii) the linear deconvolution of those non-linear absorbance values delivers incorrect concentration results.
We evaluate the influence of the relative concentration cˈ onto the stain vector direction and onto the deconvolution result on the basis of a numerical calculation of the modelled camera signals. Our approximation of the camera values Vˈ R , Vˈ G , Vˈ B for a mixture of two stains is given by the following summations of products of sampled spectral function values: with λ 1 .. λ 60 = {405 nm, 410 nm, … 700 nm} Spectral data was available in the range from 405 nm to 700 nm. The upper wavelength limit was defined by the IR cut off of the camera. The 5 nm spectral sampling has been confirmed adequate to demonstrate the proposed error effects.
With equations (S45) to (S47) we calculate camera signals and derive the absorbance values for determination of stain vectors and deconvolution of stain mixtures under different spectral conditions. Modelled stain vectors are determined by absorbance values A Rp , A Gp , A Bp of pure stains: Maximum camera values Vˈ 0R , Vˈ 0G , Vˈ 0B are calculated without staining 〈cˈ 1 = cˈ 2 = 0〉.
As stated before, we assume an influence of the stain concentration onto the stain vector direction due to the non-linear signal formation. This would be crucial for the stain separation because the deconvolution results would depend on the concentration of the pure stains presented in the reference samples. We can use the gradients of the plane projections of stain vectors to address this important question. These gradients define the vector direction. They are given by the ratios of vector components: If absorbance values of pure stains are linear related to the concentration (see Eqn. S33), these gradients are independent from the concentration and so is the vector direction.
One of these ratios is shown exemplarily in the notation of the modelled camera signals: It can be seen from this formula that the vector direction is -depending on the spectral conditions -a function of concentration.
To examine the influence of the concentration onto the vector direction, we compare stain vectors from different relative concentrations cˈ by normalization, averaging and calculating the angle difference ∆ ϕ between the normalized stain vectors (induced n) and the average stain vector component (induced a) with the equation: We introduce the average angle variation (AAV) ∆ ϕ n AAV as a rating of the vector stability and an estimation of the dimensions of the non-linear influence. High AAV values are signs of a strong influence of stain concentration onto the vector direction. For monochromatic conditions the AAV disappears.
To examine the deconvolution error we model the non-linear absorbance values of stain mixtures and deconvolved this synthetic data. We compared the deconvolution results cˈ out to the input values cˈ in by calculating the relative deconvolution error ∆cˈ out = (cˈ out -cˈ in ) / cˈ in .
Our modelling can demonstrate the dimensions of deconvolution error but cannot deliver a mean error value in the sense of a general measurement uncertainty because of the extreme non-linear nature of the signal formation and the strong dependency on the spectral system conditions.

CIE Colour Values
Visual colours of stain mixtures can be modelled by integrating spectral products of light intensity, stain transmittance and sensitivity of a CIE norm observer ( ) λ x , ( ) λ y , ( ) λ z . The CIE XYZ colour values can be described for pure stains by: (For the visible wavelength region it can be assumed: λ 1 = 380 nm, λ 2 = 780 nm.) We have approximated the CIE XYZ values for pure stains by the following sums: with λ 1 .. λ 60 = {405 nm, 410 nm, … 700 nm} To create displayable colour values we have converted the resulting XYZ signals into RGB colour signals and transferred them into non-linear sRGB colour values using a gamma correction S2 .
We expect that these sRGB colours -displayed on a monitor -are visually similar to the colours of stained biological samples observed at a microscope. This calculation does not necessarily deliver an exact colour reproduction of stain colours. We interpret this calculation as proof of concept and validation of the used spectral data.

S1.4: Stain Colours from Modelled CIE Colour Values
As proof of concept and as a verification of the stain spectra, we calculated the CIE XYZ colour values according to Eqn. (S56) to (S58), for several stains with various concentrations. The XYZ values were converted into non-linear sRGB values by Eqn. (S59) and (S60). The values were mapped into the 8bit range by a multiplicative intensity scaling in reference to a white signal 〈cˈ=0〉. Figure S1 displays the modelled stain colours. They comply with the expected colour impression of biological staining products S3 . We infer that our numeric stain spectra reasonably reproduce real stain spectra. Of note, even if the deconvolution error could as well be studied with arbitrary transmission spectra, realistic spectra help to increase the comprehensibility and the reliability of this study.
Since our signal modelling is an acceptable mathematical model for the colour simulation, we conclude that it is adequate for the examination of the deconvolution error.
In Tab. S1 and Tab. S2 the deconvolution results are shown for a few exemplary values of cˈ inDAB and cˈ inHTX for the D65 illumination/Sony ICX285AQ and the RGB LED illumination/Sony ICX285AL models. Since the system of linear equations from the 3-dimensional absorbance values is over determined for double staining, the deconvolution can be performed in the three plane projections B/G, B/R, and G/R. The deconvolution results are shown for all three projections.
The results of this modelled DAB/HTX double staining reveal important findings: A -The deconvolution results cˈ outDAB and cˈ outHTX are different in the three plane projections.
This only can be explained if the absorbance values are located outside of the stain vector plane. In this case, the three projections lead to three different systems of linear equations and subsequently to three different pairs of results. This behaviour can be seen especially in the great variance of the deconvolution result modelled with the D65 illumination (Tab. S1).
To eliminate the difference of the result pairs, the absorbance values can be mapped back perpendicular into the vector plane. This leads to identical but not to more exact deconvolution results, since the non-linear absorbance values are not shifted out perpendicular to the vector plane. The exact nature of this shift depends on the spectral characteristics of illumination, stains and sensor. It is rather a complex torsion of the absorbance out of the vector plane (Fig. S4).
Instead of a perpendicular mapping, the over determined system of linear equations can also be solved based on the

Supplementary Figure S1 | Modelled sRGB colours of several biological stains for different relative concentration values cˈ in the range from 1 to 20 (D65 illumination)
or by an orthogonalization approach, for example with the wellknown QR decomposition. We found that the errors are not generally smaller when the deconvolution is based on those methods. For example, the deconvolution errors of the modelled DAB/HTX double stain are minimal for an unmixing in the B/G plane.
B -The results cˈ outDAB and cˈ outHTX can become negative especially for wideband illumination spectra. Negative values always occur if absorbance values are lying outside of the fans defined by the stain vector projections.
C -Deconvolution errors emerge under all non-monochromatic system conditions. But the effects are largest for the wideband illumination spectra. With the 'quasi-monochromatic' combination of sequential RGB LED illumination and b/w CCD sensor Sony ICX285AL, the error effects still exist but are much less distinct. In this case, the result cˈ outDAB and cˈ outHTX are close to the input values cˈ inDAB and cˈ inHTX and the differences between the results of the three plane projections are much smaller for the RGB LED illumination.
D -The camera signals were modelled in a monochromatic approach at the three wavelengths (465nm, 540nm, 625nm; specified by the intensity peaks of the RGB LED illumination). A linear deconvolution of these signals delivers always exact results (cˈ out = cˈ in , within the computational accuracy). The results of the three plane projections are identical and they are independent from the illumination spectra. These findings comply with the theory and confirm the reliability of our model and our calculations. E -We approved the equivalence of deconvolution with normalized and non-normalized vectors according to Eqn. (S35).
Supplementary Table S1 | Deconvolution results cˈ out for a DAB/HTX double stain modelled with D65 illumination and non-normalized stain vectors for different input concentrations cˈ in (deconvolution performed in plane projections B/G, G/R, B/R) Non-monochromatic model (signals integrated with Sony ICX285AQ spectral sensitivity)

S1.6: Stain Vector Plane and non-linear Absorbance -3D-Visualiziation
To visualize the non-linear behaviour of the signal formation we model a DAB/HTX double staining for the D65 standard illumination. The sensor signals, obtained with Eqn. (S45) to (S47), are converted into absorbance values and then scaled to an 8bit range. The input concentrations cˈ DAB and cˈ HTX are varied within the range {0.1, 1, 2, 3, .. 8}. Figure S2 displays the non-linear absorbance values A R , A G , A B as RGB values in a 3D colour cube.
To visualize the vector plain spanned by the stain vectors, the components of linear absorbance values are calculated following Eqn. (S33). Normalized stain vectors from Fig. 2 (D65, cˈ=1) (see main document) are used for calculation. Concentrations c* DAB and c* HTX are varied within the range {0, 1, 2, .. 10}. Figure S3 displays the linear absorbance values, scaled to 8bit, as RGB values in a 3D colour cube.
In Fig. S4 both data are displayed together. This gives a visual impression of the non-linear formed absorbance in comparison to the linear vector plane of the stain vectors. The non-linear shift and therefore the discrepancy between non-linear absorbance formation and linear assumption are evident.
The different rotations of the 3D cube (Fig. S4) demonstrate that the non-linear absorbance shift is not perpendicular to the vector plane. It is more a rotation out of the fan spanned by the stain vectors. The non-linear absorbance values are drifting out of the vector plane especially for high values of cˈ DAB . This explains the negative cˈ HTX deconvolution result in Fig. 3 (see main document).
The form of the non-linear shift depends on spectral characteristic of illumination, stains and sensor. It can only be estimated for a particular system setup, with detailed knowledge of its spectral properties.  In Tab. S3 and S5 the 3-dimensional result data are displayed. The table is organized in 4x4 fields for the variations of cˈ inDAB and cˈ inHTX . Each field exhibits the output values (cˈ outDAB , cˈ outHTX , cˈ outFastRed ) for the variation of cˈ inFastRed (see Fig. S5). The relative errors of ∆ rel. cˈ out = (cˈ out -cˈ in )/cˈ in are shown in the same way in Tab. S4 and S6. According to Tab. S3, DAB dominates the creation of the non-linear absorbance shift. For high concentrations cˈ inDAB the deconvolution results cˈ outHTX and cˈ outFastRed become negative. The absorbance values must be located outside of the volume spanned by the stain vectors. Overall, the values cˈ in and cˈ out are not strongly correlated. The data reflects the large non-linearity caused by the wideband D65 illumination. According to Tab. S3-S6 all findings from the double stain models are confirmed by the triple stain model. The relative concentration values cˈ out are incorrect under all non-monochromatic conditions. The errors are significant larger for D65 illumination compared to RGB LED illumination. While the error dimension of the RGB LED is -depending on the requirements -acceptable for diagnostic applications, almost all D65 error values are in an unacceptable range (see Tab. S4).

S1.8: Display of Concentration Values and Gamma Correction
Deconvolution results are usually calculated as floating point numbers. Often they are converted to 8bit integer data for storage and display. This is done by a linear mapping of the relative concentrations cˈ out . The resulting 8bit concentration images are treated as monochrome images or colour look up tables are applied to generate realistic colour impression.
Alternatively, the relative concentrations cˈ out can be recalculated into intensity values according to the absorption process. For that, we can rewrite Eqn. (S5) (using Eqn. (S17) and (S22) An additional gamma correction factor k γ is used to adapt the RGB signal contrast to the diagnostic conditions. This is useful to compensate the non-linear absorption characteristic and the additional non-linear deformation of the contrast curve, caused by the constant factor arising from stain vector normalization (see Eqn. (S35)).
For illustration, we calculate the RGB display values for DAB and HTX with average normalized stain vectors from Fig.  2 (see main document). The resulting RGB colours are displayed in Fig. S6 and S7 for variations of relative concentrations cˈ and gamma correction value k γ . The D65 and the RGB LED stain vectors from Fig. 2 lead to slightly different RGB display colours. The display colours of both stains are realistic and similar to typical sample colours of microscopic specimen S3 . The effect of the gamma correction k γ is visible. An appropriate gamma value compensates the non-linear signal contrast and leads to the visual perception of linear relation between RGB signal and concentration.
Altogether, this points to a careful interpretation of concentration images. Such images do not necessarily just display the relative stain concentrations as linear or as exponential intensity values. They can contain additional gamma correction and -depending on the actual software implementation -concentration values outside of the image bit depth can be either simply clipped or mapped into the valid range. This is a problem especially for deconvolution errors in form of negative concentration values, because they lead to intensity values above the maximum intensity range (according to Eqn. (S62) to (S64)).

Error Discussion
The quality of imaging based histological and cytological sample analysis is influenced by various aspects. A total error cannot be specified exactly, for example because of the unpredictable variations of sample preparation. Quantification needs stoichiometry, absorbing dyes and intact rather than sectioned objects S4 . Since measurement also requires specification of its uncertainty, we describe the most critical sources of error and estimate their dimensions. In particular, we discuss influences of sample preparation, imaging and stain properties.
As a precondition, we assume best imaging practice and perfect system setup in terms of optical adjustment, stable and homogeneous illumination and linearity of electronics.

S1.9: Aspects of IHC Preparation
Beside other staining techniques, immunohistochemistry (IHC) is of special interest in diagnostic pathology. Therefore we particularly review this technique in context of quantitative image analysis.
IHC has changed its status from being "staining" to a qualitative, a semi-quantitative and -more and more -a quantitative target detection method. IHC sample preparation is the most important and at the same time most complex and critical link in IHC quantification. Details of IHC preparation were discussed a long time and huge efforts have been made to standardize the preparation or at least to define application specific guidelines. A large number of publications are addressing preparation, error effects and standardization S5-S10 . We can summarize that without reference, calibration, reproducibility and error specification there is no measurement, quantification and even qualification.
In IHC, ideally all antigen targets will be found and converted into saturated chromogen precipitate. But sample extraction, pre-treatment, fixation, target retrieval and detection influence the labelling of target signals. This leads to varying relation between chromogen concentration and target signal. Those variations can only be eliminated by standardization of sample processing. Saturated antigen detection does not necessarily imply stoichiometry of the "staining". Most of the chromogens used in IHC protocols produce non-stoichiometric signals. This is especially the case for both stains examined in our study, DAB and HTX. The "blueing"-step involved in HTX staining cannot be considered stoichiometric. Even DAB staining is not stoichiometric because of its macromolecular super-structure. Quantification errors due to unknown and non-linear antigen-chromogen relationship can only be avoided by standardization and calibration. Especially the latter is difficult to realize because of a missing IHC calibration standard. In addition, the request for biochemical signal saturation can be contradicted by the demand for unsaturated image signals, as will be shown below.
All steps of an IHC protocol can have critical influences. Variations of the protocol might induce unpredictable quantification errors. Thus, IHC interpretation might fall back onto a quantitative level. But nowadays, automated IHC preparation delivers highly reproducible samples. This standardization is important for a reliable correlation between antigen and stain concentration, as found in many studies 24 .
The exact characterisation of the effect of IHC variations onto IHC quantification is not our scope. We address the influences of imaging and image analysis. This is essential prior to an analysis of IHC variations.

S1.10: Imaging Errors
Microscopic imaging is affected by inhomogeneous illumination in the sensor plane due to vignetting and misalignment of optical elements. To ensure correct intensity measurements microscopic images have to be 'flat field' corrected with a background image as reference. Beside this, black level (BL) compensation is necessary. This is done by subtracting the camera noise floor from the image signal. Both, flat field and black level correction are essential in transmitted light microscopy applications.
Quantitative imaging should avoid "signal saturation". In transmitted light microscopy the signal is actually not light intensity but strength of absorption. The minimum camera signal represents the "saturation level". This minimum signal is equivalent to the maximum measurable concentration of a stain. It is determined by the camera noise floor. To prevent signal saturation, camera values should exceed the noise floor plus the shot noise (rule of thumb: 1.5 to 2 times BL).
In digital imaging there are two types of shot noise, the camera shot noise and the photon shot noise. The camera shot noise depends on the specific camera electronics and operating parameters. The photon shot noise is the non-linear noise of the incident light. It is proportional to the square root of the mean number of photon electrons n Signal .
For low light levels the total shot noise is mainly defined by the camera electronics. For high light levels it is determined mainly by the photon shot noise. An approximation of the number of total shot noise electrons is given by: where n CCD is the numbers of sensor shot noise electrons and n AMP is the numbers of amplifier shot noise electrons.
Assuming linear camera characteristics with an electronic conversion factor With Eqn. (S66) the total shot noise ∆I noise can be estimated for camera intensity I signal .
For our calculation we assume typical values of an uncooled 8bit camera with full well capacity n FullWell =50.000 electrons, sensor shot noise ∆I CCD =1, amplifier shot noise ∆I AMP =1 and maximum camera intensity value I max =255. For the entire intensity range of I signal =0..255 a nearly constant intensity variation ∆I noise ~ 1.6 was experimentally calculated. In the following we ignore the shot noise amplification caused by the flat field correction.
Quantization noise is an additional signal uncertainty. It is caused by the analog-to-digital conversion because a whole range of light intensities create identical output values. This quantization noise ∆I ADC is about a quarter of an intensity digit (or 0.25 LSB -least significant bit).
From total shot noise and quantization noise the average signal noise ∆I can be estimated:

I I I
The above noise model gives a principle description of noise sources and an explanation of their additive characteristics. However, the signal noise estimated here is a 'best case' value, only found under ideal imaging conditions. It is close to values typically stated in sensor data sheets. In practical situations, noise values are higher.
Because of the logarithmic transformation of intensity into concentration values (Eqn. (S7)), the resulting concentration uncertainty is non-linear. It can be calculated by With this equation, the relative concentration uncertainty due to shot noise and quantization noise can be calculated.
In Fig. S8 the concentration error is displayed for the image intensity I=I cam -BL, a black level BL=5, a maximum signal I 0 =255-BL and a signal noise ∆I=±0.8 for the intensity range I cam =0..255. The graph demonstrates that concentration values are accurate only in the mid intensity range. The relative concentration error rises up to 20% for low intensities and up to 80% for high intensities. For high concentrations this error is determined by the camera shot noise. It can be reduced by camera cooling. For low concentrations it is determined by the photon shot noise and cannot be eliminated.
According to this result, low as well as high concentration values are affected by the quantisation error. Depending on the application requirements, image elements with intensities close to BL respectively to I max should be rejected.
This quantization error is a statistical error originating from logarithmic conversion of the signal noise. It is independent of the deconvolution error and small compared to other influences. However, it contributes to the total measurement error by a few percent.

S1.11: DAB Absorption and Scattering
In biomedical light microscopy the image contrast is formed by an interaction between the incident light and the atoms, molecules and the structures of tissue and cell samples. The electromagnetic field of the photons is scattered by the objects of matter S11-S17 . The macroscopic effects of these alterations can be -even in a complex way -described by the Maxwell equations.
Inelastic scattering processes, such as Raman scattering and fluorescence, lead to light emission with wavelengths different from the incident light. In transmitted light imaging they can be neglected due to their vanishing intensity. Under standard conditions an elastic scattering is the predominant process. It can be divided into resonance and nonresonance scattering. Elastic scattering has the fundamental characteristics of an undetermined scattering direction, which for homogeneous and dense media leads to an interference induced net forward scattering. Therefore, the incoming light seems to simply pass the homogeneous, dense medium. Under certain conditions, the passing light is attenuated by dissipative resonance absorption. This absorption can be considered as special type of scattering, because it is initiated by the same physical interaction of photons and matter.
That said, the well-known effect of one of the most important chromogens in diagnostic imaging, 3'-3'diaminobenzidin (DAB), being "not a true absorber" S4, S18 can be treated more specific. DAB molecules are good absorbers in the visible wavelength region due their conjugated electron system. Besides that, it is known that the brown DAB staining is also "created" by the polymeric, amorphous, non-droplet structure of the DAB macromolecules S4, S19, S20 . The assumption of a homogeneous substrate is not valid for small, condensed particles and the effect of net forward scattering is lost. DAB particles are contributing to the light extinction in an additional way, different from resonance absorption described by Lambert-Beer. DAB is not a 'pure' absorber. DAB absorbs and scatters. The scatter characteristic depends on the DAB particle size, form and distribution which are all varying with the chemical properties of the DAB substance and the preparation conditions S4 .
Both, absorption and scattering, lead to a concentration dependent alteration of the spectral extinction. The concentration dependency of the scattering effect cannot be linearized by logarithmic transformation like the absorption effect (Eqn.

Supplementary Figure S8 | Relative concentration error induced by logarithmic
conversion of image noise ('best case' scenario with low image noise ∆I=±0.8 LSB) (S33)). The scattering is the source of the non-linear behaviour of the DAB stain. Bernardo et al. 22 cited "However, using DAB as a chromogen is problematic because a linear relationship between the amount of antigen and staining intensity exists only at low levels of the latter" S21 and "Image analysis systems that assess the amount of staining by measuring absorption can yield inaccurate readings because of the non-linearity of signal at higher levels of antigen" S5 . DAB is a good scatterer for electron and darkfield microscopy, but it is not well-suited for quantitative photometry.
So far, we have treated DAB staining in our study as pure absorber because (i) the deconvolution error could as well be studied with arbitrary absorption spectra and (ii) we aimed to determine the undistorted deconvolution error and thereby the maximum achievable accuracy of CD measurements.
However, to give a comprehensive view we add a scattering component into our numeric model. Thereby we can compare deconvolution error and 'scatter error'.

S1.12: Simulation of DAB Scattering
Due to the particle character of the DAB reaction product the Lambert-Beer equation (Eqn. (S2)), which assumes small stain concentrations and no interaction between the absorbing molecules, is incomplete for DAB. Photometric quantification and other methods based on light excitation cannot simply handle such 'particle stains' as pure absorbing molecules. The light scattering has to be incorporated into the extinction process.
For an estimation of the influence of light scattering we assume a DAB particle size far below the visible wavelength range. This seems plausible because of the applicability of DAB in electron microscopy. Therefore we can -as a first order approximation -assume a Rayleigh characteristic of the scattering.
We can extend Eqn. (S2) to Equation (S69) describes the extinction as function of absorption and scattering.
Herein, the Rayleigh scattering coefficient h(λ,N) depends on the wavelength λ, the wavelength specific refraction index n(λ) and the number of molecules per volume N.
In this approach, the scatter contribution and the concentration dependency of the scattering can be controlled by the parameters k 1 and k 2 .
Based on this extended model, we calculated the spectral extinction of 'scattering DAB' (sDAB) as well as the deconvolution error of sDAB/HTX double staining.
The spectra shown in Fig. S9 and S10 are calculated with k 1 = 0.2, k 2 = 0.5. These values are chosen by assuming an optical density ratio from scattering and absorption of about 1/2 (for c'=1 and λ=λ min ) and an increase of scattering with ' c . Furthermore, it is assumed that the optical density values obtained from [sd-3] already include scattering. Therefore, the pure absorption spectra are calculated by subtracting the scattering portion from the original spectral values (with c'=1; k 1 , k 2 as state above). Of course, these arbitrary values of k 1 and k 2 have to be used as long as no spectral reference data is available. Figure S9 displays the normalized optical density and demonstrates the effect of scattering for varying DAB concentration. With increasing DAB concentration, the optical density increases for short wavelengths and decreased for long wavelengths because of the signal normalisation. Note, without scattering this normalized optical density spectra would be independent of the DAB concentration per definition.
The absorption spectra in Fig. S10 increases toward saturation with increasing DAB concentration. Due to scattering, the rise of the absorption is stronger for short wavelengths than for long wavelengths. The overall increase of the spectra is not an indicator for scattering as can be seen by calculating these spectra without scattering component.
These spectral results are meaningful and plausible and reflect the behaviour of stains comprising absorption and scatter characteristics.

Supplementary Figure S10 | Extinction of sDAB for various concentrations
Supplementary Figure S9 | Optical density of sDAB for various concentrations DAB scattering mostly affects the stain mixtures with medium and high DAB concentrations. Therefore, we compare error values out c * ∆ averaged in the range c* inDAB = {4, 8} and c* inHTX = {1,2,4, 8}. According to Fig. S11 and Fig. 3, the scattering induced error for D65 and medium/high DAB concentration is about the same size as the deconvolution error. We conclude that the scattering error is not a predominant effect. When imaging is based on wideband spectra, the deconvolution error is not negligible in relation to the scatter error -even not for moderate DAB concentrations.
For narrow band illumination, the scattering effect dominates the error. The small RGB LED deconvolution error is irrelevant compared to the scatter error.
The deconvolution error, the quantization error and the scattering error increase with the DAB concentration. Therefore, care must be taken interpreting deconvolution results from high stain concentrations. This should not mislead to the assumption that errors are negligible for small and medium concentrations. Medium DAB concentrations of c* DAB = 4 are commonly found in IHC measurements (compare stain colour in Fig. S6 and S7). According to Fig. S11, the D65 errors for c* DAB =4 range from 25% up to 85%. In our opinion, errors of this dimension should be included into measurement interpretation -especially because they are not statistical errors, but distinct methodical aberrances.
The aim of our simple scattering model was to estimate the dimension of the scatter influence. It was not our intent to analyse DAB scattering in all details. However, the approach is efficient and useful. With a better understanding of the scatter characteristics and the availability of reference data, this model could be optimized, approved and integrated into stain separation techniques. Signal total shot noise k 1 , k 2 Parameters controlling the contribution and the concentration dependency of the DAB scattering k CCD CCD factor (linear signal amplification)