StxFactory { public Stx create() { return create(null, ProgressMonitor.NULL); } 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 testSignedByteBandStatistics() throws Exception { final Band band = createTestBand(ProductData.TYPE_INT8, 11, 13); final Stx stx = new StxFactory().create(band, ProgressMonitor.NULL); assertEquals(0.0, stx.getMedian(), 1.0e-1); assertEquals(0.0, stx.getMean(), 0.0); assertEquals(41.4, stx.getStandardDeviation(), 1.0e-1); }
@Test public void testFloatBandStatistics() throws Exception { final Band band = createTestBand(ProductData.TYPE_FLOAT32, 100, 120); final Stx stx = new StxFactory().create(band, ProgressMonitor.NULL); assertEquals(0.0, stx.getMedian(), 0.0); assertEquals(0.0, stx.getMean(), 0.0); assertEquals(3464.2, stx.getStandardDeviation(), 1.0e-1); }
@Test public void testFloatBandStatisticsWithGapsInHistogram() throws Exception { final Band band = createTestBand(ProductData.TYPE_FLOAT32, 10, 12); Stx stx = new StxFactory().create(band, ProgressMonitor.NULL); assertEquals(0.0, stx.getMedian(), 0.0); assertEquals(0.0, stx.getMean(), 0.0); assertEquals(34.8, stx.getStandardDeviation(), 1.0e-1); }