/*This code performs image thresholding based on pixel intensity distribution*/ for (i=1; i<=nSlices; i++) { setSlice(i); getStatistics(area, mean, min, max, std); //run("Log", "slice"); setMinAndMax(mean + std, max); run("Apply LUT", "slice"); run("Despeckle", "slice"); run("Gaussian Blur...", "sigma=1.5 slice"); }