Posted by
gankaku on
Jan 19, 2015; 3:30pm
URL: http://imagej.273.s1.nabble.com/variance-of-pixel-values-tp5011278p5011282.html
Hi Rabih,
I might give you a completely useless answer, since I do not exactly know
what you are looking for. What do you mean with "progressively". I assume
you want the variance for the pixels in one image only.
So, here is a try of a potentially helpful answer...
If you are talking about the variance in a small neighborhood all over the
image fro each pixel position than you might want to try the following
command:
>Process >Filters >Variance.
If you are dealing with grayscale images I would therefore convert the
image in a 32-bit image, avoid any auto scaling or histogram normalization
to still work on the original intensity data and then run the variance
filter on it.
If you want to have one value for the variance of the complete image you
might really need to calculate that. Here's a macro which does this:
//----------------------------------------------- macro start
original = getTitle();
w = getWidth();
h = getHeight();
getRawStatistics(area, mean, min, max, std);
for(y=0; y<h; y++) {
for(x=0; x<w; x++) {
summedIntensitySquares = summedIntensitySquares + pow((getPixel(x,y) -
mean), 2);
}
}
variance = (1 / (w * h)) * summedIntensitySquares
RMSC = sqrt((1 / (w * h)) * summedIntensitySquares);
print("Var: " + variance);
print("SD: " + RMSC);
//----------------------------------------------- macro end
Kind regards,
Jan
2015-01-19 15:12 GMT+01:00 rabih assaf <
[hidden email]>:
> Hello,
> I need a way or a plugin that can calculate the variance of pixel values (
> progressively) in an image.
> Thanks in advance,Rabih
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
--
CEO: Dr. rer. nat. Jan Brocher
phone: +49 (0)6234 917 03 39
mobile: +49 (0)176 705 746 81
e-mail:
[hidden email]
info:
[hidden email]
inquiries:
[hidden email]
web: www.biovoxxel.de
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html