void sum8BitHistograms(ImagePlus imp) { Calibration cal = imp.getCalibration(); boolean limitToThreshold = (Analyzer.getMeasurements()&LIMIT)!=0; int minThreshold = 0; int maxThreshold = 255; ImageProcessor ip = imp.getProcessor(); if (limitToThreshold && ip.getMinThreshold()!=ImageProcessor.NO_THRESHOLD) { minThreshold = (int)ip.getMinThreshold(); maxThreshold = (int)ip.getMaxThreshold(); } ImageStack stack = imp.getStack(); Roi roi = imp.getRoi(); longHistogram = new long[256]; int n = stack.getSize(); for (int slice=1; slice<=n; slice++) { IJ.showProgress(slice, n); ip = stack.getProcessor(slice); if (roi!=null) ip.setRoi(roi); int[] hist = ip.getHistogram(); for (int i=0; i<256; i++) longHistogram[i] += hist[i]; } pw=1.0; ph=1.0; getRawStatistics(longHistogram, minThreshold, maxThreshold); getRawMinAndMax(longHistogram, minThreshold, maxThreshold); copyHistogram(256); IJ.showStatus(""); IJ.showProgress(1.0); }
void sum8BitHistograms(ImagePlus imp) { Calibration cal = imp.getCalibration(); boolean limitToThreshold = (Analyzer.getMeasurements()&LIMIT)!=0; int minThreshold = 0; int maxThreshold = 255; ImageProcessor ip = imp.getProcessor(); if (limitToThreshold && ip.getMinThreshold()!=ImageProcessor.NO_THRESHOLD) { minThreshold = (int)ip.getMinThreshold(); maxThreshold = (int)ip.getMaxThreshold(); } ImageStack stack = imp.getStack(); Roi roi = imp.getRoi(); longHistogram = new long[256]; int n = stack.getSize(); for (int slice=1; slice<=n; slice++) { IJ.showProgress(slice, n); ip = stack.getProcessor(slice); if (roi!=null) ip.setRoi(roi); int[] hist = ip.getHistogram(); for (int i=0; i<256; i++) longHistogram[i] += hist[i]; } pw=1.0; ph=1.0; getRawStatistics(longHistogram, minThreshold, maxThreshold); getRawMinAndMax(longHistogram, minThreshold, maxThreshold); copyHistogram(256); IJ.showStatus(""); IJ.showProgress(1.0); }