User Tools

Site Tools


howto:working:how_to_correct_background_illumination_in_brightfield_microscopy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
howto:working:how_to_correct_background_illumination_in_brightfield_microscopy [2019/08/23 11:41]
glandini updated some links
howto:working:how_to_correct_background_illumination_in_brightfield_microscopy [2019/08/23 12:10] (current)
glandini
Line 9: Line 9:
  
   - **Camera noise **   - **Camera noise **
-        * **//Random noise//**. This is due to uncorrelated fluctuations above and below the image data as a consequence to the nature of the image sensors. These fluctuations vary with time (so they are different ​from shot to shot) and they can be reduced by averaging several consecutive images (assuming that the specimen does not move and that there is no vibration of the equipment). However ​image averaging tends to //soften// the image (i.e. some blurring with loss of sharpness). The magnitude of the noise reduction achieved by averaging is proportional to the square root of the number of images. This means that to reduce the noise by half one needs to average 4 images; to reduce it to one fourth of the original one needs to average 16 images, and so on. +        * **//Random noise//**. This is due to uncorrelated fluctuations above and below the image data as a consequence to the nature of the image sensors. These fluctuations vary with time (so they differ ​from shot to shot) and can be reduced by averaging several consecutive images ​or frames ​(assuming that the specimen does not move and that there is no vibration of the equipment). However ​frame averaging tends to //soften// the image (i.e. some blurring with loss of sharpness). The magnitude of the noise reduction achieved by averaging is proportional to the square root of the number of images. This means that to reduce the noise by half one needs to average 4 images; to reduce it to one fourth of the original one needs to average 16 images, and so on. 
-        * //**Fixed pattern noise ("hot pixels"​)** //is characterised by pixel intensities that are consistently above random noise fluctuations and it is due to faulty CCD or pixel differences in charge leakage rate (this is also called "​electronic bias" of the sensor). Fixed pattern noise becomes apparent when using long exposure times (for instance in fluorescence microscopy) and gets more accentuated with higher temperatures (that is why some cameras are cooled). ​The "hot pixels"​ appear as bright pixels in the image always in the same position in shots taken under the same conditions. These can be compensated the by subtraction of the so-called "​Darkfield"​ (a shot with the light path obstructed, taken with the same settings as the normal shot, see below).+        * //**Fixed pattern noise ("hot pixels"​)** //is characterised by pixel intensities that are consistently above random noise fluctuations and it is due to faulty CCD or pixel differences in charge leakage rate (this is also called ​the "​electronic bias" of the sensor). Fixed pattern noise becomes apparent when using long exposure times (for instance in fluorescence microscopy) and gets more accentuated with higher temperatures (the reason ​why some cameras are "cooled"). "Hot pixels"​ appear as bright pixels in the image always in the same position in shots taken under the same conditions. These can be compensated the by subtraction of the so-called "​Darkfield"​ (a shot with the light path obstructed, taken with the same settings as the normal shot, see below).
         * //**Banding noise** //may arise during the process of reading the data from the digital sensor or by interference with other electronic equipment. This type of periodic noise can be corrected to some extent with Fourier filtering.         * //**Banding noise** //may arise during the process of reading the data from the digital sensor or by interference with other electronic equipment. This type of periodic noise can be corrected to some extent with Fourier filtering.
-  - The **background illumination intensity** provided by the microscope light source optics is most often not homogeneous ​throughout ​the view field (the microscope ​condenser does not always provide "flat field" illumination;​ it is common to have a bright spot in the middle of the field). +  - The **background illumination intensity** provided by the microscope light source optics is most often not homogeneous ​across ​the view field (microscope ​condensers do not always provide "flat field" illumination;​ it is common to find a bright spot in the middle of the field). 
-  - The **colour temperature** of the light source also affects image quality. Light sources have a characteristic radiation spectrum. In most filament light bulbs this spectrum varies depending the temperature of the filament (i.e. the voltage applied to the lamp; with lower voltage the light becomes yellow-reddish while with higher voltage, it becomes bluish). Therefore, images taken at different times may exhibit backgrounds with slightly different hues. This makes it difficult to standardise procedures such as colour segmentation,​ colour separation, hue quantification,​ etc. Some microscopes have a switch to set a preset voltage to the bulb so it delivers a particular intensity and colour temperature (typically about 3200K to match indoor type B photographic film). When fixed voltages are used, then the intensity of the light is typically controlled with neutral density filters in the light path.+  - The **colour temperature** of the light source also affects image quality. Light sources have a characteristic radiation spectrum. In most filament light bulbs this spectrum varies depending the temperature of the filament (i.e. the voltage applied to the lamp; with lower voltage the light becomes yellow-reddish while with higher voltage, it becomes bluish). Therefore, images taken at different times may exhibit backgrounds with slightly different hues. This makes it difficult to standardise procedures such as colour segmentation,​ colour separation, hue quantification,​ etc. Some microscopes have a switch to preset ​voltage to the bulb so it delivers a particular intensity and colour temperature (typically about 3200K to match indoor type B photographic film). When fixed voltages are used, then the intensity of the light is typically controlled with neutral density filters in the light path.
 ===== Acquisition (a priori) correction ===== ===== Acquisition (a priori) correction =====
 ==== 1. Camera and microscope settings ==== ==== 1. Camera and microscope settings ====
Line 27: Line 27:
 ==== 2. Capture the Darkfield ==== ==== 2. Capture the Darkfield ====
  
-Block the light path (do **not** switch the microscope light off!, most microscopes have a lever that lets the user block the light path to the extension tube, where the camera is) and capture a shot. This image will be nearly black everywhere, except for the "hot pixels"​ if any (sometimes hot pixels are not very noticeable but they can be checked ​in the histogram of the image). Save the image as "​**Darkfield**" ​which will be used to compensate for hot pixels.+Block the light path (do **not** switch the microscope light off!, most microscopes have a lever to block the light path to the extension tube, where the camera is) and capture a shot. This image will be nearly black everywhere, except for "hot pixels"​ if any (sometimes hot pixels are not very noticeable but they can be shown in the histogram of the image). Save the image as "​**Darkfield**"​; it will be used to compensate for hot pixels.
  
 ==== 3. Capture the Brightfield ==== ==== 3. Capture the Brightfield ====
Line 38: Line 38:
 ==== 5. Apply the correction ==== ==== 5. Apply the correction ====
  
-The operation (in a 8 bit channel) consists of calculating the //​transmittance//​ through the specimen:+The correction ​operation (in a 8 bit channel) consists of calculating the //​transmittance//​ through the specimen:
  
 <​code>​ <​code>​
Line 44: Line 44:
 </​code>​ </​code>​
  
-First we will compensate the electronic bias (hot pixels) in the **Brightfield** and **Specimen** images.+First we compensate the electronic bias (hot pixels) in the **Brightfield** and **Specimen** images.
  
 Using the command **Process>​ImageCalculator**,​ calculate (Brightfield - Darkfield), and call the result "​**Divisor**":​ Using the command **Process>​ImageCalculator**,​ calculate (Brightfield - Darkfield), and call the result "​**Divisor**":​
Line 54: Line 54:
 </​code>​ </​code>​
  
-Do the same with the **Specimen** image: (Specimen - Darkfield) and call the result "​**Numerator**"​.+We do the same with the **Specimen** image: (Specimen - Darkfield) and call the result "​**Numerator**"​.
  
 <code java> <code java>
Line 76: Line 76:
 ==== What about random noise? ==== ==== What about random noise? ====
  
-One can improve the signal/​noise ratio by taking average shots instead of single ones. In this case the **Darkfield,​** **Brightfield** and **Specimen** images can be created as the average of several shots. If the camera or the acquiring software do not allow for average capture, one can sequentially capture the images (the [[http://www.dentistry.bham.ac.uk/​landinig/software/software.html|IJ_Robot plugin]] can be useful to automate this), then convert them to a stack and finally Z-project the stack using the **Average Intensity** option. For instance to average 16 shots, grab 16 images and then run:+One can improve the signal/​noise ratio by taking average shots instead of single ones. In this case the **Darkfield,​** **Brightfield** and **Specimen** images can be created as the average of several shots. If the camera or the acquiring software do not allow for average capture, one can sequentially capture the images (the [[https://blog.bham.ac.uk/​intellimic/g-landini-software/​|IJ_Robot plugin]] can be useful to automate this), then convert them to a stack and finally Z-project the stack using the **Average Intensity** option. For instance to average 16 shots, grab 16 images and then run:
    
 <code java> <code java>
Line 85: Line 85:
 The result "​ZProjection of Stack" is the averaged image. The result "​ZProjection of Stack" is the averaged image.
  
-==== What if I need to shoot more images? ====+==== What if I need to shoot several ​images? ====
  
 The **Divisor** image can be used for subsequent shots if the light source is very stable and no changes are made to the microscope or camera settings. The **Darkfield** image can also be re-used if no changes are made to any camera settings. If you change magnification or lighting settings you can still use the same **Darkfield** to correct the new **Brightfield** and **Specimen** images. To summarize: The **Divisor** image can be used for subsequent shots if the light source is very stable and no changes are made to the microscope or camera settings. The **Darkfield** image can also be re-used if no changes are made to any camera settings. If you change magnification or lighting settings you can still use the same **Darkfield** to correct the new **Brightfield** and **Specimen** images. To summarize:
Line 108: Line 108:
   * Use a minimization method to estimate the darkfield and brightfield images [Likar et al. Retrospective shading correction based on entropy minimization. Journal of Microscopy 2000;​197:​285-295].   * Use a minimization method to estimate the darkfield and brightfield images [Likar et al. Retrospective shading correction based on entropy minimization. Journal of Microscopy 2000;​197:​285-295].
  
-However one should be aware that **all** retrospective methods make assumptions about the image characteristics that are unlikely to be strictly satisfied in any arbitrary image. For example, it is not possible to differentiate consistently a diffuse dark patch due to the presence of stain from one due to uneven background illumination. **It is always better to correct the images with an //a priori// method**.+However one should be aware that **all** retrospective methods make assumptions about the image characteristics that are unlikely to be strictly satisfied in an arbitrary image. For example, it is not possible to differentiate consistently a diffuse dark patch due to the presence of stain from one due to uneven background illumination. ​Therefore, ​**it is always better to correct the images with an //a priori// method**.
  
 ==== What about random noise? ==== ==== What about random noise? ====
Line 117: Line 117:
 ==== What about "hot pixels"?​ ==== ==== What about "hot pixels"?​ ====
  
-With only 1 image available, a possible solution is to replace only the hot pixels with the average of its neighbours without averaging the rest of the pixels.\\ Below is a macro that implements this idea. Note that the pixels should not be clustered and they should be saturated [value=255 in 8-bit greyscale images or in all 8 bit channels of RGB images]. If the hot pixels are not saturated you can threshold them (making the hot pixels =255 and the remaining pixels=0 and adding ​this thresholded image to the original (this will saturate the hot pixels).If there are white areas that do not need denoising, one can first subtract 1 to the whole image and then saturate the pixels (so the hot pixels have a value of 255 and the white areas 254). +With only 1 image available, a possible solution is to replace only the hot pixels with the average of its neighbours without averaging the rest of the pixels.\\ Below is a macro that implements this idea. Note that the pixels should not be clustered and they should be saturated [value=255 in 8-bit greyscale images or in all 8 bit channels of RGB images]. If the hot pixels are not saturated you can threshold them (making the hot pixels =255 and the remaining pixels=0 and adding ​the thresholded image to the original (this will saturate the hot pixels). If there are white areas that do not need denoising, one can first subtract 1 to the whole image and then saturate the pixels (so the hot pixels have a value of 255 and the white areas 254). 
  
 <code java> <code java>
howto/working/how_to_correct_background_illumination_in_brightfield_microscopy.txt · Last modified: 2019/08/23 12:10 by glandini