/** Calculates and returns uncalibrated statistics for this image or ROI, * including histogram, area, mean, min and max, standard deviation, * and mode. Use the setRoi(Roi) method to limit statistics to * a non-rectangular area. * @see #setRoi * @see #getStatistics * @see ImageStatistics */ public ImageStatistics getStats() { return ImageStatistics.getStatistics(this); }
void getRawStatistics(int minThreshold, int maxThreshold) { int count; double value; double sum = 0.0; double sum2 = 0.0; for (int i=minThreshold; i<=maxThreshold; i++) { count = histogram[i]; longPixelCount += count; sum += (double)i*count; value = i; sum2 += (value*value)*count; if (count>maxCount) { maxCount = count; mode = i; } } pixelCount = (int)longPixelCount; area = longPixelCount*pw*ph; mean = sum/longPixelCount; umean = mean; dmode = mode; calculateStdDev(longPixelCount, sum, sum2); histMin = 0.0; histMax = 255.0; }
void drawEllipse(ImageProcessor ip, ImageStatistics stats, int count) { stats.drawEllipse(ip); }
ip2 = convertToOriginalDepth(imp2, ip2); } else { saveResults(new ImageStatistics(), roi); return; ImageStatistics stats = ImageStatistics.getStatistics(ip2, AREA+MEAN+STD_DEV+MODE+MIN_MAX+MEDIAN+limit, imp2.getCalibration()); if (saveR!=null) ip2.setRoi(saveR); if ((roi instanceof Line) && (measurements&CENTROID)!=0) {
void measureAngle(Roi roi) { if (rt.size()>0) { if (!IJ.isResultsWindow()) reset(); int index = rt.getColumnIndex("Angle"); if (index<0 || !rt.columnExists(index)) { clearSummary(); rt.update(measurements, imp, roi); } } ImageProcessor ip = imp.getProcessor(); ip.setRoi(roi.getPolygon()); ImageStatistics stats = new ImageStatistics(); saveResults(stats, roi); }
/** * @return Area of the convex hull */ public double getAreaConvexHull(){ if(areaConvexHull!=-1){ return areaConvexHull; } Polygon polyPoints = getConvexHull(); /* int i, j, n = polyPoints.npoints; areaConvexHull = 0; for (i = 0; i < n; i++) { j = (i + 1) % n; areaConvexHull += polyPoints.xpoints[i] * polyPoints.ypoints[j]; areaConvexHull -= polyPoints.xpoints[j] * polyPoints.ypoints[i]; } areaConvexHull /= 2.0; areaConvexHull = Math.abs(areaConvexHull)*cal.pixelHeight*cal.pixelWidth;; */ Blob helpblob = new Blob(polyPoints, -1); ImagePlus imp = generateBlobImage(helpblob); areaConvexHull = imp.getStatistics().getHistogram()[0]*cal.pixelHeight*cal.pixelWidth; return areaConvexHull; }
ip2 = convertToOriginalDepth(imp2, ip2); } else { saveResults(new ImageStatistics(), roi); return; ImageStatistics stats = ImageStatistics.getStatistics(ip2, AREA+MEAN+STD_DEV+MODE+MIN_MAX+MEDIAN+limit, imp2.getCalibration()); if (saveR!=null) ip2.setRoi(saveR); if ((roi instanceof Line) && (measurements&CENTROID)!=0) {
void measureAngle(Roi roi) { if (rt.size()>0) { if (!IJ.isResultsWindow()) reset(); int index = rt.getColumnIndex("Angle"); if (index<0 || !rt.columnExists(index)) { clearSummary(); rt.update(measurements, imp, roi); } } ImageProcessor ip = imp.getProcessor(); ip.setRoi(roi.getPolygon()); ImageStatistics stats = new ImageStatistics(); saveResults(stats, roi); }
boolean limitToThreshold = (Analyzer.getMeasurements()&LIMIT)!=0; imp.getMask(); histogram = stats.getHistogram(); if (limitToThreshold && histogram.length==256) { ImageProcessor ip = imp.getProcessor();
/** This method calculates and returns complete uncalibrated statistics for * this image or ROI but it is up to 70 times slower than getStats(). * @see #setRoi * @see #getStats * @see ImageStatistics */ public ImageStatistics getStatistics() { return ImageStatistics.getStatistics(this, Measurements.ALL_STATS, null); }
ImageStatistics imgstat = new ImageStatistics(); ImageProcessor curip = null; double currentInt = 0.0;
boolean limitToThreshold = (Analyzer.getMeasurements()&LIMIT)!=0; imp.getMask(); histogram = stats.getHistogram(); if (limitToThreshold && histogram.length==256) { ImageProcessor ip = imp.getProcessor();
void drawEllipse(ImageProcessor ip, ImageStatistics stats, int count) { stats.drawEllipse(ip); }
void getRawStatistics(int minThreshold, int maxThreshold) { int count; double value; double sum = 0.0; double sum2 = 0.0; for (int i=minThreshold; i<=maxThreshold; i++) { count = histogram[i]; longPixelCount += count; sum += (double)i*count; value = i; sum2 += (value*value)*count; if (count>maxCount) { maxCount = count; mode = i; } } pixelCount = (int)longPixelCount; area = longPixelCount*pw*ph; mean = sum/longPixelCount; umean = mean; dmode = mode; calculateStdDev(longPixelCount, sum, sum2); histMin = 0.0; histMax = 255.0; }
public static ImageStatistics getStatistics(ImageProcessor ip) { return getStatistics(ip, AREA+MEAN+STD_DEV+MODE+MIN_MAX+RECT, null); }
/** This method calculates and returns complete uncalibrated statistics for * this image or ROI but it is up to 70 times slower than getStats(). * @see #setRoi * @see #getStats * @see ImageStatistics */ public ImageStatistics getStatistics() { return ImageStatistics.getStatistics(this, Measurements.ALL_STATS, null); }
/** Calculates and returns uncalibrated statistics for this image or ROI, * including histogram, area, mean, min and max, standard deviation, * and mode. Use the setRoi(Roi) method to limit statistics to * a non-rectangular area. * @see #setRoi * @see #getStatistics * @see ImageStatistics */ public ImageStatistics getStats() { return ImageStatistics.getStatistics(this); }
public static ImageStatistics getStatistics(ImageProcessor ip) { return getStatistics(ip, AREA+MEAN+STD_DEV+MODE+MIN_MAX+RECT, null); }
/** Returns the mean value of a rectangular ROI */ private double meanRoiValue(final ImageProcessor ip, final int x, final int y, final int width, final int height) { ip.setRoi(x, y, width, height); return ImageStatistics.getStatistics(ip, Measurements.MEAN, null).mean; }
private MinMaxContainer getMinMax(ImageProcessor ip) { ImageStatistics stats = ImageStatistics.getStatistics(ip, ij.measure.Measurements.MIN_MAX, null); return new MinMaxContainer(stats.min, stats.max); }