@Test public void testQuantileBreaksHistogramsPercentagesMoreClassesThaIntervals(){ RenderedImage image2 = ImageUtilities.createImageFromArray( new Number[] {1,1,1,1,1,1,1,1,8,8,8,8,11,11,11,16}, 4, 4); ParameterBlockJAI pb2 = new ParameterBlockJAI(new ClassBreaksDescriptor()); pb2.addSource(image2); pb2.setParameter("method", ClassificationMethod.QUANTILE); pb2.setParameter("numClasses", 5); pb2.setParameter("extrema", getExtrema(image2)); pb2.setParameter("histogram", true); pb2.setParameter("histogramBins", 100); pb2.setParameter("percentages",true); RenderedImage op2 = JAI.create("ClassBreaks", pb2, null); Classification classification2 = (Classification) op2.getProperty(ClassBreaksDescriptor.CLASSIFICATION_PROPERTY); assertNotNull(classification2); double[] percentages2 = classification2.getPercentages(); assertEquals(percentages2.length, 3); assertTrue(percentages2[0]==50.0); assertTrue(percentages2[1]==25.0); assertTrue(percentages2[2]==25.0); }
@Override public Object getProperty(String name) { Object obj = properties.getProperty(ClassBreaksDescriptor.CLASSIFICATION_PROPERTY); if (obj == Image.UndefinedProperty) { Classification c = preCalculate(); if (c != null) { properties.setProperty(ClassBreaksDescriptor.CLASSIFICATION_PROPERTY, c); } } return super.getProperty(name); }
ClassBreaksOpImage extends StatisticsOpImage { @Override public Object getProperty(String name) { Object obj = properties.getProperty(ClassBreaksDescriptor.CLASSIFICATION_PROPERTY); if (obj == Image.UndefinedProperty) { Classification c = preCalculate(); if (c != null) { properties.setProperty(ClassBreaksDescriptor.CLASSIFICATION_PROPERTY, c); } } return super.getProperty(name); } }
ClassBreaksOpImage extends StatisticsOpImage { @Override public Object getProperty(String name) { Object obj = properties.getProperty(ClassBreaksDescriptor.CLASSIFICATION_PROPERTY); if (obj == Image.UndefinedProperty) { Classification c = preCalculate(); if (c != null) { properties.setProperty(ClassBreaksDescriptor.CLASSIFICATION_PROPERTY, c); } } return super.getProperty(name); } ClassBreaksOpImage(
            RenderedImage image,
            Integer numClasses,
            Double[][] extrema,
            ROI roi,
            Integer[] bands,
            Integer xStart,
            Integer yStart,
            Integer xPeriod,
            Integer yPeriod,
            Double noData,
            Boolean percentages); }
ClassBreaksOpImage extends StatisticsOpImage { @Override public Object getProperty(String name) { Object obj = properties.getProperty(ClassBreaksDescriptor.CLASSIFICATION_PROPERTY); if (obj == Image.UndefinedProperty) { Classification c = preCalculate(); if (c != null) { properties.setProperty(ClassBreaksDescriptor.CLASSIFICATION_PROPERTY, c); } } return super.getProperty(name); } ClassBreaksOpImage(
            RenderedImage image,
            Integer numClasses,
            Double[][] extrema,
            ROI roi,
            Integer[] bands,
            Integer xStart,
            Integer yStart,
            Integer xPeriod,
            Integer yPeriod,
            Double noData,
            Boolean percentages); @Override Object getProperty(String name); @Override void setProperty(String name, Object value); }
ClassBreaksOpImage extends StatisticsOpImage { @Override public Object getProperty(String name) { Object obj = properties.getProperty(ClassBreaksDescriptor.CLASSIFICATION_PROPERTY); if (obj == Image.UndefinedProperty) { Classification c = preCalculate(); if (c != null) { properties.setProperty(ClassBreaksDescriptor.CLASSIFICATION_PROPERTY, c); } } return super.getProperty(name); } ClassBreaksOpImage(
            RenderedImage image,
            Integer numClasses,
            Double[][] extrema,
            ROI roi,
            Integer[] bands,
            Integer xStart,
            Integer yStart,
            Integer xPeriod,
            Integer yPeriod,
            Double noData,
            Boolean percentages); @Override Object getProperty(String name); @Override void setProperty(String name, Object value);  }