Gimp Retinex for Enhancing Images from Microscopes

We recently proposed in the International Journal of Sciences the use of GIMP, the GNU Image Manipulation Program, for enhancing the panoramic radiographic images. One of its tools, the Retinex filter, revealed itself quite suitable for detecting weak features hidden in the shadows of these radiographic images. Here we show that this filter, besides being relevant for medical and biologic imaging, can be helpful for enhancing the images coming from microscopy techniques related to other scientific investigations.


Introduction
The raw images we obtain from optical and electronic devices are sometimes requiring a further processing to be fully appreciated and properly interpreted by human eye and mind. Moreover, a processing for a correct vision of images is fundamental during the analysis of medical data and for their uses in the subsequent diagnoses. In this context, in Ref. 1 we have discussed the role of some filters from the image processing software GIMP, in enhancing the images of panoramic radiography. We found that, in the case of the observation of mental nerve canals, the GIMP Retinex tool was quite promising [1]. These canals are in areas of the panoramic image that are usually quite dark, but Retinex allows seeing the details of mandibles in the shadows of the image (an example is proposed in the upper panel of Fig.1).
Retinex methods of image processing are an answer to the discrepancies that exist between images recorded by a camera or an electronic device and the real scene we can directly observe. As told in [2], humans are able seeing details both in the shadows and in nearby illuminated areas, whereas a photograph of the same scene is showing either the shadows as too dark or the bright areas as overexposed. The reason is that human vision has some peculiar features concerning colours, brightness and contrast of a scene, different from that of recording devices. Even with wide dynamic range imaging systems, the recorded images will not be seen the same as the real observation [3]. For this reasons, several algorithms of image processing had been developed, mainly based on Retinex models, for bridging the gap between colour images and human vision of the same scene [4]. These methods are inspired by the human vision biological mechanism to adapt itself to unfavourable conditions. GIMP Retinex is a freely available tool of this set of methods. It improves the visual rendering of an image when lighting conditions are not good. The algorithm, which is the root of Retinex filter, is a MultiScale Retinex with Color Restoration algorithm. The output of GIMP Retinex filter can be easily adjusted by selecting different levels, scales and dynamics from its dialog box. Here in the following, we will show that this filter, besides being relevant for medical and biologic imaging, can be helpful for enhancing images coming from microscopy techniques related to other scientific investigations.

Retinex models
The idea of a Retinex model was conceived by Edwin H. Land, [4][5][6][7], as a consequence of his researches on human colour perception. This perception involves both neurons of the retina and cerebral cortex of the brain. And then, from the two words "retina" and "cortex", he coined the term "Retinex". Through the years, as explained in Reference 4, Land evolved his model of human vision from a random walk computation [5] to its last form proposed in 1986 as a center/surround spatially opponent operation [7], related to the neurophysiological Retinex functions. Let us note that Edwin Land was working on colour http://www.ijSciences.com Volume 4 -June 2015 (06) 73 vision since 1950's [8,9], as shown by the results he divulgated in the Scientific American, May 1959.
Jobson and his co-workers [3,10], implemented the Retinex operation in a single-scale Retinex (SSR), that evolved in a multiscale Retinex (MSR) model [4,10]. For colour images, a weight factor was introduced on different channels with colour restoration (MSRCR); these three methods are explained in detail by Ref. 3. For what concerns the general form of the method, it is similar to the Difference-of-Gaussian (DOG) functions used in the science of natural vision to model both the receptive fields of individual neurons and the perceptual performance of processes [11]. In the Retinex approach, the surround Gaussian is greatly enlarged and weakened and a logarithmic function is included to have a shunting inhibition. Adaptive Gaussian filters, to have an adaptive Retinex, had been proposed too [12]. Recently in [13], a variational Bayesian method for Retinex had been implemented; the method is using a hierarchical Bayesian model with Gibbs distributions for reflectance and illumination, and gamma distributions for the model parameters.

Using GIMP Retinex for radiographic images and biology
GIMP is a free and open-source software used for processing images and for free-form drawing. In the Reference 1, we have proposed the use of several of its tools for enhancing the images from panoramic radiography (the reader can find more details on GIMP tools in the tutorials at http://www.gimp.org). We found that, in the case of the observation of mental nerve canals, the GIMP Retinex tool was that giving the best results. This filter is quite simple to use, through its specific dialog box with image preview.
Of course, GIMP and its tools can be used in general for medical imaging [14] and for x-ray radiography. Let us note that the use of GIMP Retinex is suggested for radiographic images by GIMP tutorial itself. Some examples and discussions are given in Ref. 15.
Here, in the Figure 1, we can see examples of x-ray images processed with GIMP Retinex. Let us stress that Retinex allows seeing details both in dark and bright areas of the image. For what concerns the use of GIMP Retinex in biology, it had been involved in the analysis of the colony morphology of a mycobacterium [16]. In [17,18], image analysis and visualization were performed using GIMP to merge fluorescent and differential inference contrast (DIC) images and to adjust levels and brightness and to remove out-of-focus background fluorescence.

GIMP Retinex for microscopy in condensed matter physics
Besides the biological researches, several other investigations require an analysis of images obtained from a microscope, such as those of the condensed matter physics, for instance. Sometimes, these images are not giving the best possible results. Again, we can try to apply GIMP Retinex: let us see here two examples.
First, we can use this filter to enhance images coming from the polarized light microscopy. This microscopy is largely used in the investigation of liquid crystal mesophases. As we first proposed several years ago [19], an image processing of the polarized light microscope images helps the analysis of texture transitions. In the Figure 2, three examples of GIMP Retinex filtering are given: the upper panels show a mesomorphic phase of an oxadiazole compound [20], observed with the polarized light microscope; the middle and lower panels are showing some droplets of a nematic phase, before and after the Retinex filtering. The examples reveal how the filtering allows observing the details in dark or foggy images of liquid crystal cells.
The same is true for other microscope techniques, such as those involving a Kerr microscope. This microscope is used to investigate the magnetization structure of a material. The magneto-optic Kerr microscopy is based on the Kerr effect that concerns the changes to light reflected from a magnetized surface [21]. In the upper panel of Figure 3 (courtesy of Gorchy, Wikipedia), we can see a photomicrograph containing several crystal grains of NdFeB. The magnetic domains are made visible via contrast by means of such microscopy. As the author of this image is explaining, the domains are the light and dark stripes faintly visible within each grain. We can enhance the visibility of these stripes by applying GIMP Retinex: the result is shown in the lower panel of Figure 3.

GIMP Retinex for SEM microscopy
In fact, a quite interesting use of GIMP Retinex is for images obtained by means of scanning electron microscopes (SEMs). In the Figure 4, we can see how GIMP Retinex can be successfully used for seeing details in the shadows of these images. In the lower right panel, for instance, we can see that this filter allows seeing the features of a polypyrrole coating on a textile fibre [22], even in the shadow of a deep split of it.
Let us conclude with another example, which is also relevant for the use of Retinex in biology: the example is proposed in the Figure 5, where we can see a glomerulus of mouse kidney with a broken capillary, in SEM magnification 10,000x (courtesy SecretDisc, on Wikipedia). GIMP Retinex allows seeing the details in the capillary vessel: we can observe the endothelial surface of the capillary as containing numerous pores and some structures of localized thickenings on the surface. These examples show that even the images, which seem too dark or too bright to be considered capable of giving information, are objects that can be easily converted in useful images by the GIMP Retinex filter.
http://www.ijSciences.com  good: in this case, after the processing, we can see the mandibular canal, which is in the shadow of the original image. The Multi-Scale Retinex with Color Restoration (MSRCR) algorithm, which is at the root of GIMP filter, is inspired by the eye biological mechanisms of adapting to poor lighting conditions. In the middle and lower panels we have GIMP Retinex applied to x-ray images (in the lower panel, a further adjustment was used). These are abdominal radiographies of a baby (courtesy Nevit Dilmen, on Wikipedia). Let us note than, besides being capable of seeing in the dark, Retinex is also able of enhancing the risibility of area which are too bright.  -GIMP Retinex is used for observing details in the shadows of these scanning electron microscope (SEM) images. In the upper left panel, we can see some activated charcoal (courtesy Mydriatic, on Wikipedia); on the right, an area of it is enhanced by means of GIMP Retinex. In the middle and lower panels, we have the original SEM images on the left, and, on the right, the images after Retinex filtering of some polypyrrole coated fibres for textiles [22].