Weird Result:Masking after CorrectIlluminationCalculate

Hi guys!

I’ve come across a weird result and it took me some time to figure out how to supress it.

  1. Take any image
  2. Apply correctilluminationcalculate, use background, rescale illumination function to YES.
  3. Either Correctilluminationapply or Imagemath with divide operation.
  4. Apply a mask that is bigger than 50% of the total area of image.
  5. The masked output is a lot brighter than the image after illumination correction. You can see on the same opened window that the masked image is a lot brighter, but when you hover over the same regions, the intensity value at the bottom of the window say the same number!!!

====
If you use rescale illumination fucntion to NO, and correctilluminationapply or imagemath with SUBTRACT, this does not happen.

Why? Am i doing something weird?

Cheers,

Roberto

Hi Roberto,

I think part of the issue is that you should not use the Background method with rescaling enabled; please see the help for the rescaling option for a bit more detail on this. Rescaling should only be used if the Regular method is to be used, which is applied with Division in CorrectilluminationApply, and not used if the Background method is to be used, which is applied with Subtraction.

The reason for this is that there is a good chance that the Background method is producing an illumination correction function with pixels that are 0 or very close to it. If this function is applied with division, some of the pixels will become very large or even undefined (since division by 0 is approximated by infinity). Rescaling adds 1 to the illumination correction function to keep this from happening, but you would then not want to subtract this result to correct your image.

Regards,
-Mark

Hi MBray,

sorry for the late reply, and thank you for the tip. I’ve sorted it out with your answer.

Cheers,

Roberto

Great; glad to hear it!
-Mark