# A Weighted Histogram-Based Tone Mapping Algorithm for CT Images
## 1 Introduction
### Tone Mapping  
CT images are often _windowed_, which means that only part of the dynamic range is displayed, and this part is processed with histogram equalization-based methods. The problem can be seen as a high dynamic range imaging issue: the high dynamic range CT image should be tone mapped to be displayed on a low dynamic range display while preserving local contrast. High dynamic range images are often processed with tone mapping operators to keep or enhance local contrast while compressing the dynamic range, to fit into the displaying medium's dynamic range. Besides histogram equalization, the simplest dynamic range compression algorithm is gamma compression which maps source image intensity to a target image intensity in the following way:  
\[I=I_{0}^{\gamma}, \tag{4}\]  
where \(I_{0}\), \(I\) are the source and target images, respectively. \(I_{0}(x,y)\) and \(I(x,y)\) are used to refer to the pixel values of these images. While this effectively reduces the dynamic range if \(\gamma<1\), it does not ensure good local contrast. A popular choice to keep or increase local contrast is the base layer--detail layer separation. The base layer (\(B\)) of an image consists of larger structures and has a high dynamic range, while the detail layer (\(D\)) is the difference between the original image (\(I_{0}\)) and the base layer:  
\[B =\mathcal{F}(I_{0}), \tag{5}\] \[D =I_{0}-B. \tag{6}\]  
Any filter which removes small details could be used for this separation, including a Gaussian filter, and edge preserving denoising filters (median, total variation minimization, bilateral filter, among others). After the dynamic range compression of the base layer, the details should be added back using a scale factor (\(\alpha\)) and can even be enhanced. This could be simple multiplication (\(\alpha>1\)), or more sophisticated edge enhancement where the detail layer is pre-processed before it is combined with the compressed base layer into a tone mapped image (TMI):  
\[TMI=\text{compress}\{B\}+\alpha\cdot D. \tag{7}\]  
This base-detail layer separation technique is the basis of numerous algorithms. Using a Gaussian filter for detail separation and leaving the base layer uncompressed yields the unsharp masking algorithm, which belongs to the wider class of local contrast enhancement techniques. Applying any compression on the base layer, even simple linear rescaling, yields a tone mapping algorithm. The approach can be generalized into multi-layer separation using linear [15] or nonlinear decomposition [16]. The quality of these approaches depends on the separation filter and the base layer compression. One very active research area is to find good, edge preserving filters avoiding such artefacts. For instance, the following filters were proposed for base-detail separation: Gaussian filter, anisotropic diffusion, weighted least squares (WLS) [16], total variation (TV) based filters using \(L_{1}\)[17] and \(L_{0}\)[18] norms and bilateral filter [19], among others. While this separation is more like a framework than an algorithm, it is an important building block of tone mapping operators and detail manipulation algorithms. Besides the layer separation approach, many other tone mapping approaches have been developed. Reinhard'02 operator simulates the effect of photographic zones with an additional dodging-and-burning step [20]. [PERSON]'s approach [21] is based on gradient attenuation. The smaller than threshold gradients are slightly magnified while larger gradients are suppressed. The attenuated gradients lead to a Laplace-Poisson problem which can be solved iteratively. [PERSON] presented a perceptual framework for contrast processing, which is related to the gradient suppression approach but models perceptual contrast. This is not the only way to model the human visual system (HVS). [PERSON]'s method is built on the logarithmic compression of luminance values [22], and the Reinhard'05 [23] operator models the photoreceptor adaptation on local and global levels. The approach by [PERSON] et al.