Posted by
Michael Schmid on
Feb 01, 2013; 10:43am
URL: http://imagej.273.s1.nabble.com/Problem-with-normalized-variance-for-stack-tp5001625p5001633.html
Hi Sathya,
this macro writes where it finds the maximum of the normalized variance.
Anyhow, it might be a good idea if you could have a look into macro programming yourself; it's not difficult, and you will be able to solve such problems yourself...
macro "Normalized_Variance_for_Stack" {
saveSettings();
run("Clear Results");
run("Set Measurements...", " mean standard redirect=None decimal=5");
max = -1;
sliceOfMax = -1;
for (slice=1; slice<=nSlices(); slice++) {
setSlice(slice);
run("Measure");
mean = getResult("Mean", slice-1);
stddev = getResult("StdDev", slice-1);
normVar = stddev*stddev/mean;
if (normVar > max) {
max = normVar;
sliceOfMax = slice;
}
setResult("NormVar", slice-1, normVar);
}
print("Maximum in slice "+sliceOfMax);
restoreSettings();
}
Michael
________________________________________________________________
On Jan 31, 2013, at 22:39, sathya1 wrote:
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html