FalseColor-Python: A rapid intensity-leveling and digital-staining package for fluorescence-based slide-free digital pathology

Slide-free digital pathology techniques, including nondestructive 3D microscopy, are gaining interest as alternatives to traditional slide-based histology. In order to facilitate clinical adoption of these fluorescence-based techniques, software methods have been developed to convert grayscale fluorescence images into color images that mimic the appearance of standard absorptive chromogens such as hematoxylin and eosin (H&E). However, these false-coloring algorithms often require manual and iterative adjustment of parameters, with results that can be inconsistent in the presence of intensity nonuniformities within an image and/or between specimens (intra- and inter-specimen variability). Here, we present an open-source (Python-based) rapid intensity-leveling and digital-staining package that is specifically designed to render two-channel fluorescence images (i.e. a fluorescent analog of H&E) to the traditional H&E color space for 2D and 3D microscopy datasets. However, this method can be easily tailored for other false-coloring needs. Our package offers (1) automated and uniform false coloring in spite of uneven staining within a large thick specimen, (2) consistent color-space representations that are robust to variations in staining and imaging conditions between different specimens, and (3) GPU-accelerated data processing to allow these methods to scale to large datasets. We demonstrate this platform by generating H&E-like images from cleared tissues that are fluorescently imaged in 3D with open-top light-sheet (OTLS) microscopy, and quantitatively characterizing the results in comparison to traditional slide-based H&E histology.


Introduction
Modern microscopy methods enable life scientists and clinicians to visualize complex tissue structures, where recent technological advancements have radically enhanced our understanding of biological processes and disease pathologies. However, clinical diagnostic practices have not taken full advantage of these modern microscopy techniques. In particular, the gold- standard diagnostic method of histology is based on centuries-old technologies, where tissues are preserved in harsh fixatives, destructively sectioned onto glass slides, stained with simple chromogens (most-commonly with hematoxylin and eosin, i.e. H&E), and manually imaged with analog brightfield microscopes. In order to improve throughput, non-destructiveness, sampling extent, and in some cases, to provide 3D information, several slide-free microscopy techniques have recently been explored for use in clinical settings. For example, techniques such as confocal microscopy [1,2], multiphoton microscopy [3][4][5][6], microscopy with UV surface excitation (MUSE) [7][8][9], and structured illumination microscopy (SIM) [10,11] have been explored as slide-free alternatives to frozen-section histology for rapid interoperative guidance. Additionally, light-sheet microscopy technologies, such as open-top light-sheet (OTLS) microscopy [12][13][14], when used in conjunction with tissue-clearing techniques [15], have been explored for slide-free nondestructive 3D pathology. These techniques generally rely on fluorescence collected with a sensitive monochrome detector. Since pathologists are accustomed to certain color schemes generated by standard chromogens, such as the pink and purple hues associated with H&E staining, the ability to render grayscale fluorescent images with color palettes that mimic standard histology can play a major role on the ability of pathologists to interpret and adopt slide-free pathology methods in the future. Several groups have published software methods to convert two-channel fluorescence images into "virtual H&E" images. One such virtual H&E algorithm was published in 2009 by Gareau [16]. Using an additive model, this method rendered the reflectance contrast generated by collagen and cytoplasm, and the fluorescence generated by a hematoxylin analog, to mimic H&E staining. Bini et al. in 2011 further refined this model by analyzing the transmitted spectra of multiple slides that were independently stained with either hematoxylin or eosin [17]. A limitation of the additive approach is that in standard H&E histology, the classic pink and purple hues are the result of spectral mixing of the two dyes present in the specimen, according to a nonlinear absorption process (Beer-Lambert-law attenuation). Additive models rely on the linear superposition of intensities, which is non-physical and does not reliably mimic the appearance of conventional H&E histology.
To address these limitations, a false-coloring model based on the Beer-Lambert law of absorption was developed by Giacomelli et al. in 2016 [18]. The Beer-Lambert model accounts for the spectral mixing of chromogenic (absorption-based) dyes and their wavelength-dependent nonlinear attenuation of light (i.e. exponential decay as a function of concentration). As a result, this model can accommodate multiple fluorescent stains with overlapping spectra without loss of contrast or non-physical results. Note that in addition to H&E, other chromogens can be modeled, such as the DAB stain most-commonly used for immunohistochemistry (IHC) [13].
The previous approaches described above, for false coloring fluorescent images to mimic conventional chromogenic (absorption-based) stains, have a number of practical shortcomings that prevent them from generating consistent results. In particular, three main points motivate the work described in this article: 1. Significant variations in the appearance of slide-free digital pathology images can occur due to uneven staining within a specimen (intra-specimen variability). In particular, thick unsectioned tissues exhibit diffusion barriers that often lead to nonuniform staining. This is more pronounced with large agents such as antibodies but also affects smaller agents. Additionally, when imaging optically cleared tissues, samples that are not fully cleared can exhibit a scattering-induced loss of signal as a function of imaging depth.
2. The appearance of both standard histology and slide-free fluorescence images can vary greatly between institutions, or even within an institution, due to day-to-day variations in sample preparation, staining protocols and imaging parameters (inter-specimen variability) [19]. In the presence of these variabilities, simple false-coloring algorithms can fail unless  software parameters are manually tweaked, often by trial-and-error. 3. Finally, 3D slide-free digital pathology datasets are often hundreds of gigabytes to terabytes in size, which is 3 to 4 orders of magnitude larger than standard 2D whole slide images. To facilitate clinical translation, false-coloring algorithms must be able to process these large 3D datasets in an efficient and scalable manner.
It bears mentioning that several deep-learning methods have been developed to render H&E-like images from unstained tissue sections imaged with label-free imaging modalities such as brightfield and autofluorescence microscopy [20][21][22], multi-photon microscopy [23], and quantitative phase-contrast imaging [24]. Similar machine-learning-based approaches could be used to create H&E-like images from tissues labeled with exogenous fluorophores (i.e. fluorescent analogs of H&E). However, these methods not only require large amounts of training data but are also highly sensitive to pre-analytical variations such as staining protocols, imaging parameters, and hardware settings. In contrast, the ability to use an explainable physics-based approach for digital staining is likely attractive for many end users and regulatory agencies, allowing for easier error identification, debugging, and compatibility with different imaging platforms [25].
In this manuscript we present FalseColor-Python, which enables rapid and robust digital staining of fluorescence images to mimic the appearance of chromogenic stains using the Beer-Lambert model. As a pre-processing step prior to false-coloring, an intensity-leveling routine, analogous to flat fielding, is used to locally and globally normalize image intensities, thereby mitigating the effects of both intra-and inter-sample variability. In particular, the code presented here is specifically optimized to generate H&E-like images of tissues stained with a two-channel fluorescent analog of H&E (i.e. a fluorescent nuclear stain that mimics hematoxylin, along with the stromal stain, eosin, which is naturally fluorescent) and imaged with 3D open-top light-sheet (OTLS) microscopy [12][13][14]. We show that FalseColor-Python enables accurate and reproducible H&E false-coloring that qualitatively and quantitatively matches the appearance of H&E whole slide images, but with less variability than is seen with standard histology. GPU acceleration is used for efficient and scalable processing of large 3D datasets.
Note that while H&E false-coloring is demonstrated here, FalseColor-Python can be tailored to accommodate other preferred fluorescent staining combinations and individual color preferences. For example, FalseColor-Python can be adapted to false-color fluorescence images to mimic other chromogens, such as DAB (used in standard immunohistochemistry [13]) or other special stains (e.g. PAS, Masson's Trichrome, Toluidine Blue). In addition, while False-Color-Python is optimized for large 3D datasets, it can easily be applied to 2D images as well. for processing large two-channel 3D datasets using FalseColor-Python. For our specific implementation of this code, input data is stored on disk in the Hierarchical Data Format (HDF5), which is a common multi-resolution 3D image format ( Fig  1A). The advantage of multi-resolution file formats like HDF5, or similar formats such as N5, is that they contain multiple down-sampled versions of the imaging data. For our 3D microscopy data, we use a 16x down-sampled version of the data (low-resolution) to rapidly calculate an approximate global background level for each channel. The background level is calculated by first ignoring all pixels that are below a threshold value (i.e. black pixels), which we have defined as 4 standard deviations above the detector noise floor. The intensity of the 20 th percentile of the remaining pixels is defined as the background value, which is due to a combination of tissue autofluorescence and nonspecific staining. We have found that for all of the 3D datasets we have examined, this 20% threshold is effective. However, for tissues that are very densely stained, in which there are few "background" pixels, this threshold may need to be adjusted. Once calculated, this background level is uniformly subtracted from the datasets, whether down-sampled as in Fig 1B or full-resolution as on the left side (numerator) of Fig 1F. Next, the down-sampled dataset is partitioned into uniformly sized data cubes. In our case, each data cubes corresponds to a 100 x 100 x 100 μm 3 volume of tissue (where 100 μm corresponds to 256 pixels in our raw datasets) ( Fig 1C). We use this partitioned data to create a lowresolution 3D "intensity-leveling map," which will subsequently be used to remove global intensity fluctuations from the original dataset (see Introduction). The 3D intensity-leveling map is generated by calculating the median pixel value for every local data cube ( Fig 1D). Given the size of the full-resolution 3D image data, the subsequent steps are sequentially performed on individual 2D image planes (i.e. different depths) within the full-resolution 3D dataset. Each full-resolution 2D intensity-leveling map ( Fig 1E) is generated from the downsampled 3D leveling map ( Fig 1D) through linear interpolation. By using linear interpolation, abrupt intensity differences between adjacent data cubes are smoothed out, preventing grid artifacts in the final leveling map. All of the full-resolution 2D intensity-leveling maps are scaled by an empirical weighting factor for each channel, α, which is held constant for the entire 3D dataset. This weighting factor is used to control the relative intensity of each fluorescence channel, which can be tuned by users to generate a desired appearance for the final false-colored RGB images (see below). Intensity leveling is achieved by taking a pixel-by-pixel ratio of each full-resolution image plane (background-subtracted) and its corresponding interpolated intensity-leveling map ( Fig 1F). The result is an image in which the median value of every local region (i.e. data cube) is approximately equal (due to the ratioing step), in which many of the large-scale (gradual) intensity irregularities are reduced ( Fig 1G). Finally, the leveled images from both fluorescence channels are passed into the Beer-Lambert false-coloring algorithm, which generates a color (RGB) image ( Fig 1H). The intensity-leveling and virtual H&E routines are accelerated with a GPU using the CUDA framework from Python's Numba library [26]. A diagram illustrating the full workflow is shown in the methods section.

FalseColor-Python workflow
Note that the size of the data cubes ( Fig 1C) that are used for generating an intensity-leveling map should be chosen based on the spatial scale of the intensity nonuniformities that one wishes to correct. For images that exhibit very gradual or minimal intensity variations, larger cube sizes can be used. Small cube sizes will remove finer-scale intensity fluctuations but may also remove fluctuations/contrast that are due to real tissue structure rather than staining artifacts.
To demonstrate the utility of this method, a comparison of virtual H&E staining with and without intensity-leveling is shown in Fig 2. Here a single plane from a 3D microscopy dataset of an optically cleared lung specimen is shown. The specimen was stained with a fluorescent nuclear stain TOPRO-3 Iodide (Cat: T3605, Thermo-Fisher) and was optically cleared with Ethyl-Cinnamate (Cat: 112372, Sigma-Aldrich) [14]. The cleared tissue volume was then imaged using OTLS microscopy [27]. The Beer-Lambert false-coloring algorithm was applied to a single grayscale image without intensity leveling (Fig 2A). In this example, the exterior of the tissue was stained more heavily than the interior. In Fig 2B, the intensity-leveling procedure was incorporated into the false-coloring routine, such that the false-colored nuclei appear much more uniform across the entire image.

Colorimetry to mimic standard histology
For the clinical adoption of slide-free digital pathology, virtual H&E algorithms must consistently render virtual H&E images that qualitatively and quantitatively match the coloration of standard histology. To ensure that FalseColor-Python's virtual H&E algorithm mimics the color palettes of standard histology, we measured the color properties of 65 publicly available whole slide images (H&E) of prostate adenocarcinoma from the Cancer Digital Slide Archive [28] (Fig 3A). 10 regions of interest (ROIs) were selected from each whole slide image at a magnification of 200x (20x objective), (Fig 3B). Hematoxylin and eosin stains were segmented from each region of interest using color deconvolution [29,30]. The color deconvolution algorithm generated a probability map for each dye, where pixel values represent the probability of that pixel belonging to one of the top-two color components of the image (i.e. hematoxylin or eosin), (Fig 3C & 3D). These probability maps were used to create binary masks for each structure using Otsu's thresholding method [31]. The binary masks yielded segmented images of the nuclei (hematoxylin stain) and stroma (eosin stain). This process was repeated for all ROIs and the median color properties of each stain were quantified and plotted based on the hue, saturation, value (HSV) color model (Fig 3E & 3F). We used these measured HSV values as a target for our virtual H&E images. In other words, in FalseColor-Python, we have adjusted the color parameters used in the Beer-Lambert false-coloring algorithm so that the median HSV color properties of the virtual H&E images approximate that of standard whole slide images.
For the clinical adoption of slide-free pathology, virtual H&E images not only need to mimic the color palette of standard H&E but must also be consistent and robust in the presence of variations between samples, for example due to differences in staining protocols or imaging parameters. By incorporating intensity-leveling, our virtual H&E algorithm rendered

PLOS ONE
FalseColor-Python: A digital-staining package for slide-free digital pathology images with similar appearance despite inter-sample intensity differences. As an example, fluorescent images of two prostate tissue samples are shown in Fig 4A, in which significant differences in fluorescence intensities are seen (when imaged with the same device and settings). The intensity levels for each fluorescence channel (TO-PRO-3 and eosin) are shown in the accompanying histograms. Despite these differences in intensity, the resulting virtual H&E images of each sample are qualitatively and quantitatively similar. On the right-most column of Fig 4A, a histogram of the value (V) component of each virtual H&E image is plotted and is comparable for both images after the intensity-leveled false-coloring routine is applied.
To quantitatively compare the consistency of FalseColor-Python with standard H&E histology, we measured the HSV color model parameters for 2100 virtual H&E images from 14 samples of prostate tissue imaged with 3D OTLS microscopy and then processed with FalseColor-

PLOS ONE
FalseColor-Python: A digital-staining package for slide-free digital pathology

PLOS ONE
FalseColor-Python: A digital-staining package for slide-free digital pathology Python. To measure the color properties of the virtual H&E images, we used the same colordeconvolution method that was used to measure the color properties of whole slide images from the Cancer Digital Slide Archive (described previously). It should be noted that while the color parameters were adjusted to allow our virtual H&E images to match the color parameters of standard H&E images, once these values were determined, all virtual H&E images used in this analysis were processed in a fully automated fashion using the exact same parameters for intensity-leveling and coloration. Our results show that the color properties of virtual H&E data processed with FalseColor-Python match the measured values of standard H&E, as expected ( Fig 4B). Furthermore, the color properties of virtual H&E images processed with FalseColor-Python are much more consistent (less standard deviation) than the color properties of standard H&E-stained whole slide images. Table 1 lists the median and standard deviation of each color property for both standard and virtual H&E. Finally, an image atlas is shown in Fig 5 to demonstrate that FalseColor-Python renders consistent virtual H&E images across tissue types and to demonstrate that FalseColor-Python is easily adjusted to mimic other color spaces in standard histology (DAB staining).

Discussion
We have developed FalseColor-Python, a rapid intensity-leveling and digital-staining package for converting grayscale fluorescence images into color images that mimic conventional chromogenic (absorption-based) stains. In particular, we demonstrate the rendering of virtual H&E images from thick tissues stained with a fluorescent analog of H&E and imaged in 3D. To improve the consistency of our false-coloring method in the presence of both inter-sample and intra-sample variations in staining/intensity, we have developed and incorporated a 3D intensity-leveling routine (Figs 1 & 2). We analyzed the color properties of standard H&E images (Fig 3) and used this data to ensure that the virtual H&E images rendered by FalseColor-Python are representative of standard histology. Our results show that the virtual H&E images rendered by FalseColor-Python are qualitatively and quantitatively similar to standard H&E histology regardless of variations in intensity, as for example due to differences in sample preparation, imaging device, and/or imaging parameters (Fig 4). In particular, we have shown that FalseColor-Python renders virtual H&E images that not only quantitatively match the appearance of standard H&E images, but with less variability in coloration than is seen with standard histology (Fig 4B).
The ability to render quantitatively and qualitatively consistent virtual H&E images is of critical importance for the adoption of fluorescence-based imaging methods in anatomic pathology. Staining non-uniformities and depth-dependent intensity variations are common data-quality issues in fluorescence imaging, particularly for nondestructive slide-free 3D imaging modalities. In developing this intensity-leveling technique, we have taken advantage of the multiple down-sampled versions of an imaging dataset that are stored in a multi-resolution image format such as HDF5 (Fig 1A). However, down-sampling of imaging data is straightforward and intensity-leveling maps can be generated from any 3D imaging data. For our 3D microscopy data, optimal performance has been seen with data cubes of 100 x 100 x 100 μm 3 however, users can make adjustments as needed to best suit their data. This tunability is demonstrated in an example located on our GitHub repository. Finally, for certain images with intensity nonuniformities, enhanced performance is seen using an implementation of contrast-limited adaptive histogram equalization (CLAHE) as a pre-processing step before intensity-leveling is performed. This is included as an optional method within FalseColor-Python but was not used in the examples shown in this study. More specifically, CLAHE is included as an optional method for use in cases where intensity changes within the sample are large over small distances such that intensity leveling alone may be insufficient to yield qualitatively acceptable results. For example, thick tissues stained with large agents that have difficulty diffusing into tissue interiors may see improved results by applying CLAHE before false coloring to enhance relative signal strength between high-and low-signal regions. However, CLAHE should be used judiciously since it can also increase noise in the images.
In terms of limitations, our intensity-leveling method is best suited for images where staining is present throughout the entirety of the sample, but where the spatial variations in that signal are gradual compared with the high-resolution features of interest (e.g. Fig 2) In cases in which large-scale (gradual) intensity variations are biologically real and informative to end users (e.g. pathologists), there is the possibility that our intensity-leveling methods will mask (i.e. flatten) such global-intensity variations. However, this could be mitigated by tuning the size of the data-partitioning cubes as outlined in Fig 1. A significant outcome of this study is that virtual H&E images rendered by FalseColor-Python exhibit significantly less variability in color parameters than standard histology. This is not surprising considering the obvious differences in appearance seen in histology images generated by independent labs, and even within individual labs at different times. The measured median color-property values of our virtual H&E images were all well within one standard deviation of the color properties of standard H&E images.
We recognize that the standard H&E data used in this analysis represents a subset of all possible color presentations found in histology. Further, we acknowledge that there is a high degree of subjectivity and personal preference regarding the optimal coloration for standard H&E images. Therefore, it is possible to tune the appearance of false-colored images if so desired. For simplicity, RGB color parameters, which are easily measured from any image, are included as arguments in FalseColor-Python's Beer-Lambert false-coloring algorithm so that users can make adjustments as needed. The leveling constant, α, is used to control the relative intensity of each channel, which affects the appearance of the final virtual H&E image. For our OTLS datasets, we found that α values of 1.5 and 3.7 were appropriate leveling constants for the hematoxylin and eosin channels, respectively. These particular values allowed the color properties of our virtual H&E data to consistently match the measured values derived from standard H&E images (Fig 3). Lower values of α result in a darker/stronger staining appearance. Further discussion of adjusting color settings is provided in an example on the online repository (see GitHub link at the end of this article).
Note that all methods used for colorimetry analysis of standard and virtual H&E images (e.g. Fig 3) are included in FalseColor-Python. As mentioned in the introduction, FalseColor-Python is easily adapted for other fluorescence-to-chromogenic staining transformations, for example to render images that mimic chromogenic immunohistochemistry (i.e. DAB stain) (Fig 5C & 5F).
FalseColor-Python contains several methods that use GPU acceleration. For example, CUDA-based implementations of the Beer-Lambert false-coloring algorithm are included in FalseColor-Python as well as several preprocessing steps such as intensity-leveling, image sharpening, and background subtraction. For users without access to GPU hardware, equivalent CPU-based processing methods are available as alternatives in FalseColor-Python. In a simple speed comparison, we measured the average time to process 200 two-channel 16-bit images (2048 x 2048 pixels each) with FalseColor-Python, using either GPU-or CPU-based Beer-Lambert false-coloring algorithms and preprocessing steps (i.e background subtraction,

PLOS ONE
intensity-leveling). The GPU-based process was faster by over a factor of 6 (116 +/-17 ms per image vs. 789 +/-18 ms per image). There is room for further improvement by developing objects and methods within FalseColor-Python that can process large 3D datasets in parallel. For example, implementing multi-resolution file formats that allow for parallelized read operations (e.g. N5 instead of HDF5) will enable FalseColor-Python to process 3D datasets even more efficiently. Parallelized processing in FalseColor-Python is discussed in an example on the GitHub repository.
In summary, FalseColor-Python renders virtual H&E images that qualitatively and quantitatively match the coloration of standard H&E images, as well as other chromogenic stains. A key component of FalseColor-Python is the incorporation of an intensity-leveling method that corrects for intensity non-uniformities commonly seen in 3D fluorescent datasets, both within one sample and between different samples (i.e. intra-and inter-specimen variability). The color settings in FalseColor-Python are customizable to suit user preferences, with interpretable parameters that facilitate error identification and troubleshooting. FalseColor-Python is equipped with GPU-accelerated methods that allow it to process large 3D datasets efficiently. Developers who are interested in contributing to FalseColor-Python should submit pull requests via the GitHub repository.

OTLS imaging
Tissue samples were stained with a fluorescent nuclear stain, TO-PRO-3 (Cat: T3605, Thermo-Fisher) at a 1:2000 dilution and eosin (Cat: 3801615, Leica Biosystems) at a 1:2000 dilution for 4 hours at room temperature with light shaking. Samples were optically cleared with ethyl-cinnamate (Cat: 112372, Sigma-Aldrich). Stained and cleared samples were imaged on a custom OTLS system [14]. A 660-nm laser was used to excite the nuclear dye, TO-PRO3, and a 561-nm laser was used to excite eosin. Each channel was imaged separately, in succession, with a 16-bit sCMOS camera. For more information on OTLS imaging see our previous publications [12][13][14].

Image processing
Two channel OTLS datasets were stored on disk in the HDF5 format with metadata in an XML file structured for analysis using BigStitcher [27]. A custom compression filter (B3D) was used to provide 10x compression. The fine alignment of all OTLS data was performed in Big-Stitcher and fused to disk as a separate HDF5 file. Before virtual H&E rendering (as described in the manuscript), an optional sharpening routine was used on each image to enhance edges. The full workflow is outlined in the diagram of Fig 6. Intensity-leveling maps (Fig 1D) are generated by calculating the median intensity value within a specified 3D image volume (data cube). For an input image I, with specified background threshold b, the pixel value M for the intensity leveling map is given by: Here i, j, k indicates the index. The pixel value of the intensity leveling map is set to the median value of the data cube above the background threshold, Eq (1). If the median value within the data cube falls below the background threshold, the level is set to a constant value, A, which is equal to the 95 th percentile of I by default, Eq (2). This ensures that low-signal background regions appear black in the intensity-leveled image ( Fig 1G) and that they appear white in the false-colored (e.g. H&E mimicking) RGB image (Fig 1H).
Virtual H&E rendering of two-channel fluorescence images was achieved using the Beer-Lambert false-coloring algorithm [18]. Grayscale intensities are converted into RGB images Operations that act on 3D image data are highlighted in green and 2D operations are highlighted in blue. Input arguments such as file path, image planes to process (identified with HDF5 z-index), and desired intensity-leveling constants are parsed for processing. Lowresolution data is read into memory and the initial intensity-leveling map is generated. Background levels are computed from the low-resolution data. Full-resolution images are read into memory for processing. Full-resolution data undergoes background subtraction and image sharpening as preprocessing steps. The full-sized intensity-leveling map is generated via linear interpolation. Intensity leveling is applied to each image. The intensity-leveled images undergo the Beer-Lambert false-coloring process, and the resulting RGB image is saved to disk. Writing to disk occurs in a separate thread for efficiency, indicated by the dashed box.
where H, E are fluorescent images, M H,E is the 2D image leveling map for each channel, α is the intensity-leveling constant for each channel, j n , k n are the color settings for hematoxylin and eosin respectively and n = R, G, B. Based on the colorimetry measurements described in the manuscript (Fig 3), we adjusted FalseColor-Python's hematoxylin and eosin color parameters until the measured color properties of virtual H&E images consistently matched those of standard H&E. After this calibration no further adjustments were necessary. Table 2 lists the RGB color settings used for processing OTLS images. For leveling our OTLS images, α H = 1.5 and α E = 3.7 were chosen as scaling constants for the majority of our datasets. GPU acceleration for image processing was done using the cuda.jit decorator from the Numba library [26]. Implementation of GPU acceleration is done in such a way that the user needs no experience with the CUDA framework to accelerate their code (see examples on the GitHub repository). To achieve GPU acceleration, users only require a virtual environment equipped with the Anaconda's cudatoolkit [32] and a CUDA capable GPU. GPU processing was done with a Nvidia Quadro P4000. A script containing the workflow as described in Fig 1 can be found on the GitHub repository.

Histology data collection
To quantify the HSV color space of traditional histopathology, 65 whole slide images of prostate adenocarcinoma biopsies from the Cancer Genome Atlas, cancer.digitalslidearchive.org [28] were examined, 10 equally sized fields of view from each whole slide image were taken at 20x magnification.

Color-Space quantification
To accurately analyze the color space of histology and OTLS images, the hematoxylin and eosin channels were separated from one another via a binary mask generated by color deconvolution from the scikit-image.color python package [30]. This color deconvolution-based segmentation was used for both standard and virtual H&E images. A binary mask was generated for each structure by first applying a median filter to the result of the color deconvolution, and then applying Otsu's thresholding method [31]. Small objects were removed from the initial mask using an area threshold. A binary opening with a structuring element of a disk, r = 3, was applied to the resulting image. The input RGB image was converted to HSV space and then each mask was applied to generate the final segmented image for each structure. This process was repeated across 650 regions of interest taken from publicly available prostate adenocarcinoma whole slide images and 2100 OTLS virtual H&E images from 14 prostate samples. Once each structure was segmented, the median value for each color property (HSV) was recorded from each segmented image. Zero valued areas, which resulted from the application of the binary mask, were ignored.

Code availability
The full FalseColor-python code, example data, and colorimetry analysis methods, are publicly available at https://github.com/serrob23/falsecolor. The repository includes instructions for installation and annotated examples.