Background Removal in large stack - divide by shading model fails

Sorry if this is the wrong place, I am not sure where else to go. Hope someone can help me with this.

I have a few hundred 8-bit SEM images in a stack (I use FIJI/ImageJ). These images have an uneven background which I need to remove, thankfully this background appears to be the same for all the images. Working on single images the best solution I have found is the “a-Posteriori Shading Correction 514 v3” which produces a shading model and divides the raw image with this model.

It only works on single images, but does give the user the produced shading model, so it should be possible to divide all the images in the stack by the same shading. However, this does not appear to be the case. I cannot reproduce the same result by dividing the raw image by the shading. The attached figure shows the results.

a: Raw image. b: Produced shading. c: Result through plug-in. d and e: results using “calculator plus” (d) and “image calculator” (e)

The raw image (a) is analyzed and b is produced. The plugin supposedly divides a by b to produce c. BUT Pure division produces a black image (e). By using Calculator Plus and multiplying the division by a constant I get something like d, but never anything like c.

How can I reproduce what the plugin does, so that I can apply the action to my entire stack?

1 Like

The “division by the background” is not really the division you do with the image calculator.
You need the Image Calculator Plus to divide one image by another and rescale by a factor all in one go (in your case the constant k1 is the max value that the original image could take (e.g. 255 if it is 8-bit).
Leave the constant k2 to 0.
That should work. If you still get a different result, it might be because you are using 32bit results that probably get rescaled for display? Check that the image types are the same before comparing results.

1 Like