Substracting Background with similar color as particles


#1

Hi,
I’m trying to do particle analysis with stained droplets. Since the preparation only allows multiple layers to be created (otherwise the larger droplets would be destroyed), I wonder how I can substract the slightly colored background from the image.


So far I tried Substract background (rolling Ball) commadn, combined with Enhance Local Contrast (CLAHE) and tried to replace red with magenta afterwards to simplify the color thresholding (did it in HSB color space with Default thresholding). It should be as automated as possible for a stack of images.
It allready worked out for a reduced amount of layers, though I’m still struggeling to seperate the particles from one another.

Any suggestions on how I might proceed; which functions of Image J might come in handy?
Thanks in advance.


#2

Good day Felix,

these are not the same images, are they?

Please be more specific about what you want to obtain in the end.
And please don’t provide JPG-images. Original raw TIF- or PNG-format is ok.

The illumination is highly uneven. How do you capture the images (microscope, camera type)?

Regards

Herbie


#3

Good day to you, herbie.
Those are not the same images, here are the version before and after processing.


This is the first image after correction of the camera error (chip is too small, that’s why the edges of the images are so uneven), i substracted an blank image via NxN filter. I used the uncorrected image for its higher saturation.
The second image should show to what extend i was capable to process the following image.

The goal should be to analyze the feret diameter of all particles greater then 2µm. Microscope is a Leica DMRXE, I’m not sure about the camera. Hope i got all the information you wanted.

Regards,
Felix


#4

[…] after correction of the camera error (chip is too small, that’s why the edges of the images are so uneven)

I’m pretty sure that this is an optical problem, at least it is not a sensor problem. The microscope may not be set up correctly.

So you are even interested to analyze the defocussed bubbles?

The background is terribly uneven (cloudy) and I see little hope for an automatic procedure.

I think you should considerably improve the image acquisition process and perhaps the sample preparation and staining.

Regards

Herbie


#5

No, i wanted to write a macro for the microsope table to aquire a certain amount of images. Therefore i don’t need to analyue bubbles outside the focus.

I hoped to limit that to a minimum, as every kind of sample preparation could destroy the bubbles. Best i can do is

Regards

Felix


#6

Good day Felix,

this image is much better but there is still a coloured border which means optical or illumination problems. Try to optimize the microscope setting.

To correct flaws in the image acquisition process by post hoc image processing is generally much more costly than optimized acquisition and sometimes it is even impossible.

I’m trying to do particle analysis with stained droplets.

Therefore i don’t need to analyue bubbles outside the focus.

I must admit that there is at least a certain vagueness in these formulations …

i wanted to write a macro for the microsope table

Did you have a look at Micro-Manager?

Good luck

Herbie


#7

Hello herbie,

Should I just crop out the border of the image? The micrsocope is not at my institute, and I was told there are few options to further improve the settings. Or maybe look for another microspoe plus camera?

I am looking for the increase in droplet size over time as a parameter for the stability. Therefore I need to take several images of the same emulsion for statistical relevance. If I miss some of the smaller bubbles it will (hopefully) not be that significant.

Thanks for the hint with Micro-Manager. I will take a look at it.

Regards,
Felix


#8

Felix,

I’m not a microscopist but I know some microscope-specialists at ZEISS and they tell me that the average user of microscopes doesn’t run them with optimum setting. Of my several professions optics and image processing are relevant here and I really can judge the quality of micrographs, although I wouldn’t even call me an average user of microscopes. You realize the difference?

Or maybe look for another microspoe plus camera?

I think a better setting will do. The best mircroscope is useless if its setup is flawed …

Should I just crop out the border of the image?

This doesn’t cure the reason, only some of the symptoms.

The micrsocope is not at my institute

This is a suboptimum situation and I’d try to visit the microscopist and investigate how competent this person really is and if you have doubts, look for someone who really knows how to run a microscope and does this on a regular basis.

Have success

Herbie


#9

Herbie,

I see your point and I try to build up connections to other working groups with expertise in microscopy.

In the mean time I aquired an image of the microscope error


and I tried my ways with the Image Calculator, but am not confident with the result yet. As substraction of the error did not lead to a evener background, i tried to average the image with the inverted error.
Starting Picture was this one:

Are there more elegant ways to use the Image Calculator to even out the background?

Thanks in advance

Felix


#10

Felix,

such an operation requires some considerations …

A

  1. You have colour images
  2. Every RGB-color channel has 8bit depth
  3. What do you expect as difference?

B

  1. Your reference image shows structures that are missing in the image with objects
  2. Consequently the difference image suffers from these structures
  3. Gaussian lowpass filtering of the reference image may help

I would treat the RGB channels separately as 32bit images and finally combine the difference images to RGB. Take care of possible negative values in the 32bit difference images.

This may not be all of what needs to be considered, hence you see that post hoc removal of acquisition flaws is costly and may perhaps not even lead to satisfying results.

Go ahead

Herbie


#11

Here is another possibility which might be able to cope with the uneven background.
Convert your image to HSB.
Select the S (saturation channel). The orange droplets are quite distinct from the background.
You could threshold these with some of the various methods available.
Or you could also try duplicating the S channel and inverting it, (droplets are dark now) and use the regional gradients threshold method:
http://www.mecourse.com/landinig/software/threshgrad/threshgrad.html

Paper describing it in more detail here: http://onlinelibrary.wiley.com/doi/10.1111/jmi.12474/pdf


#12

Thank you, gabriel

I will test it with your regional gradients threshold method.