|
Hi,
I'm posting in the hope that someone can help me out with the following problem:
I'm using ImageJ to obtain mean and total (IntDen) intensity for greyscale images using the analyze particles option.
I use a macro to analyze large numbers of images like this.
The procedure is the following:
I use the image calculator to play with my images and obtain images with a black background and
several greyscale regions of interest.
I then threshold the images to remove the black background.
I then use "analyze particles" to obtain the IntDen and mean values.
The problem is that I've noticed that when I have one particle the mean and IntDen values are correct, but when I have several particles the mean and IntDen values are the mean of the values that have already been calculated for the particles. This means that the size of each particle is not taken into account. I'll give an example:
If I have one particle with 1 million pixels, mean grey value=250, IntDen= 250 million
and 10 particles with 1 pixel each, mean grey value= 2, IntDen=2
Then the summary stats will give:
size 90910, mean gray value=25, IntDen= 22 million
Therefore the average size of the particles is correct, and the average mean gray value and IntDen of the particles is also correct but is not weighted for particle size.
What I need is the total IntDen of all of the particles and the weighted mean of all of the particles (the mean of all none background areas in the image).
I can easily calculate either of these if I have the other as ImageJ does give me the total area in pixels.
The only way I've found to do this for the moment is to check the "display results" box in the "analyze particles" window and then calculate the weighted values myself in excel. The problem with this is that I have thousands of images which is why I wrote a macro in the first place!!
If anyone has any ideas I'd be extremely grateful.
Thanks in advance,
Andy
|