StxFactory { public static void accumulate(RasterDataNode rasterDataNode, int level, RenderedImage roiImage, Shape roiShape, StxOp op, ProgressMonitor pm) { Assert.notNull(rasterDataNode, "raster"); Assert.argument(level >= 0, "level"); Assert.argument(roiImage == null || level == 0, "level"); Assert.notNull(pm, "pm"); final PlanarImage dataImage = ImageManager.getInstance().getGeophysicalImage(rasterDataNode, level); if (dataImage.getSampleModel().getNumBands() != 1) { throw new IllegalStateException("dataImage.sampleModel.numBands != 1"); } PlanarImage maskImage = getEffectiveMaskImage(rasterDataNode, level, roiImage); Shape maskShape = getEffectiveShape(rasterDataNode, roiShape); accumulate(op, dataImage, maskImage, maskShape, pm); } StxFactory(); StxFactory withMinimum(Number minimum); StxFactory withMaximum(Number maximum); StxFactory withMean(Number mean); StxFactory withStandardDeviation(Number standardDeviation); StxFactory withIntHistogram(boolean intHistogram); StxFactory withLogHistogram(boolean logHistogram); StxFactory withHistogram(Histogram histogram); StxFactory withResolutionLevel(Integer resolutionLevel); StxFactory withRoiMask(Mask roiMask); StxFactory withRoiImage(RenderedImage roiImage); StxFactory withRoiShape(Shape roiShape); StxFactory withHistogramBinCount(Integer histogramBinCount); StxFactory withHistogramBins(int[] histogramBins); Stx create(); Stx create(Mask[] roiMasks, RasterDataNode[] rasters, ProgressMonitor pm); Stx create(RasterDataNode raster, ProgressMonitor pm); static void accumulate(RasterDataNode rasterDataNode,
                                  int level,
                                  RenderedImage roiImage,
                                  Shape roiShape,
                                  StxOp op,
                                  ProgressMonitor pm); static final int DEFAULT_BIN_COUNT; }
@Test public void testThatAccumulateWithSummaryStxOpGetsTheRightMinMax() { final Band testBand = createFloatTestBand(10, 10, 20, 60); final SummaryStxOp stxOp = new SummaryStxOp(); StxFactory.accumulate(testBand, 0, null, null, stxOp, ProgressMonitor.NULL); assertEquals(20, stxOp.getMinimum(), 1e-44); assertEquals(60, stxOp.getMaximum(), 1e-44); assertEquals(40, stxOp.getMean(), 1e-7); final double variance = 137.4009443244; assertEquals(variance, stxOp.getVariance(), 1e-7); assertEquals(Math.sqrt(variance), stxOp.getStandardDeviation(), 1e-7); }