Proper Way of Going about Flat-Field / Shading Correction

Analysis goals

Would like to flat-field correct images that were obtained on a spinning disk confocal.

Challenges

I collected some images using our confocal, and would like to correct for uneven illumination using a procedure similar to what is described here:

I obtained my dark images and collected bright images for the 4 channels that I’m using, and then took the z-projected average and median, respectively. I then try to apply the following formula to calculate my corrected image:

resulting image = (acquired image - background) / (flatfield image - background)

My question is: should I be checking the “32-bit (float) result” option in the calculator setting?

image

All my images are 16-bit, but I’ve found that if I don’t check 32-bit in the final calculation, the resulting image is just dark. If I do check 32-bit, the intensity values in the resulting images are now on the order of ~0.1 instead of ~1000. The image itself looks flat-fielded, but it’s unclear to me how the values are changing?

Thanks for any help!

1 Like

Additional question: has anyone had experience using the Shading Correction plugin?

https://imagej.nih.gov/ij/plugins/shading-corrector.html

Hi, we developed an illumination correction/shading correction tool: BaSiC

It works if your image foreground is not that correlated. If you encounter a problem, you can send me an email.

Hi @paragoon,

you can use the Flat Field correction from the BioVoxxel Toolbox (BioVoxxel Toolbox - ImageJ). There, you just need to give original and flat-field image and the rest is done automatically.
If you want to do it by manually the image calculator is not sufficient. You will need to use the “Calculator Plus” (comes pre-installed, in Fiji at least), because after the devision you will need to multiply the resulting pixel values with the average background value to push the output image into the positive/visible intensity range again. Problem is, that you will need to measure always the average background intensity. Thus, the existing plugins are more straight forward to use.
So, basically what you have to do is: (image1 * mean background intensity of image2) / image2. Or extend it additionally with the background subtraction as in your formula.

Hope that helps

1 Like

Hi both,

Thank you for the response, really appreciate it! I’ll give the suggested ideas a try.

@biovoxxel : For the Calculator Plus option: Would you mind clarifying a bit what you mean by always needing to measure the average background intensity? I assume you mean the intensity of the “bright” image? once I measure the average background intensity of the “bright” image once, can’t I just use that value for any subsequent raw image correction? For example, this is my “bright” image captured with a dye that fluoresces in the DAPI channel:

This is an example of a raw image:

And this is the flat-field corrected image, using ImageCalculator plus. The k1 value in this case was me simply taking the mean intensity of the bright image. This value shouldn’t need to change unless I update the bright image, right?

Thank you for the time and help!

1 Like

That is correct :smile:

Thanks Jan! Appreciate the help!