public static ImageStatistics getStatistics(ImageProcessor ip, int mOptions, Calibration cal) { Object pixels = ip.getPixels(); if (pixels instanceof byte[]) return new ByteStatistics(ip, mOptions, cal); else if (pixels instanceof short[]) return new ShortStatistics(ip, mOptions, cal); else if (pixels instanceof int[]) return new ColorStatistics(ip, mOptions, cal); else if (pixels instanceof float[]) return new FloatStatistics(ip, mOptions, cal); else throw new IllegalArgumentException("Pixels are not byte, short, int or float"); }
ImageStatistics getStatistics(ImageProcessor ip, int mOptions, Calibration cal) { switch (imageType2) { case BYTE: return new ByteStatistics(ip, mOptions, cal); case SHORT: return new ShortStatistics(ip, mOptions, cal); case FLOAT: return new FloatStatistics(ip, mOptions, cal); case RGB: return new ColorStatistics(ip, mOptions, cal); default: return null; } }
ImageStatistics getStatistics(ImageProcessor ip, int mOptions, Calibration cal) { switch (imageType2) { case BYTE: return new ByteStatistics(ip, mOptions, cal); case SHORT: return new ShortStatistics(ip, mOptions, cal); case FLOAT: return new FloatStatistics(ip, mOptions, cal); case RGB: return new ColorStatistics(ip, mOptions, cal); default: return null; } }
public static ImageStatistics getStatistics(ImageProcessor ip, int mOptions, Calibration cal) { Object pixels = ip.getPixels(); if (pixels instanceof byte[]) return new ByteStatistics(ip, mOptions, cal); else if (pixels instanceof short[]) return new ShortStatistics(ip, mOptions, cal); else if (pixels instanceof int[]) return new ColorStatistics(ip, mOptions, cal); else if (pixels instanceof float[]) return new FloatStatistics(ip, mOptions, cal); else throw new IllegalArgumentException("Pixels are not byte, short, int or float"); }
private void addMean(int column, int start) { double value = Double.NaN; if (start!=-1) { float[] c = column>=0?rt.getColumn(column):null; if (c!=null) { ImageProcessor ip = new FloatProcessor(c.length, 1, c, null); if (ip==null) return; ip.setRoi(start, 0, ip.getWidth()-start, 1); ip = ip.crop(); ImageStatistics stats = new FloatStatistics(ip); if (stats==null) return; value = stats.mean; } } summaryTable.addValue(ResultsTable.getDefaultHeading(column), value); }
private void addMean(int column, int start) { double value = Double.NaN; if (start!=-1) { float[] c = column>=0?rt.getColumn(column):null; if (c!=null) { ImageProcessor ip = new FloatProcessor(c.length, 1, c, null); if (ip==null) return; ip.setRoi(start, 0, ip.getWidth()-start, 1); ip = ip.crop(); ImageStatistics stats = new FloatStatistics(ip); if (stats==null) return; value = stats.mean; } } summaryTable.addValue(ResultsTable.getDefaultHeading(column), value); }