Revision 11182 trunk/libraries/libRaster/src/org/gvsig/raster/dataset/properties/DatasetHistogram.java

View differences:

DatasetHistogram.java
55 55
	public DatasetHistogram(RasterDataset dataset){
56 56
		this.dataset = dataset;
57 57
	}
58
		
58

  
59 59
	/**
60
	 * Obtiene el minimo valor de las estadisticas de un histograma.
61
	 * @return double
62
	 */
63
	public double getMinimum() {
64
		return dataset.getStatistics().getMinimun();
65
	}
66

  
67
	/**
68
	 * Obtiene el maximo valor de las estadisticas de un histograma.
69
	 * @return double
70
	 */
71
	public double getMaximum() {
72
		return dataset.getStatistics().getMaximun();
73
	}
74
	/**
60 75
	 * Obtiene el histograma. Si puede conseguirlo del fichero rmf ir? all? a 
61 76
	 * buscarlo sino lo calcular?.
62 77
	 * @return histograma 
63 78
	 */
64 79
	public Histogram getHistogram() throws FileNotOpenException, RasterDriverException {
65 80
		try {
66
			if (dataset != null) {				
81
			if (dataset != null) {
82

  
83
				dataset.getStatistics().calcFullStatistics();
84

  
67 85
				if (dataset.getDataType() == IBuffer.TYPE_BYTE)
68
					histogram = new Histogram(dataset.getBandCount(), 255);
86
					histogram = new Histogram(dataset.getBandCount(), 255, dataset.getStatistics().getMinimun(), dataset.getStatistics().getMaximun());
69 87
				else
70
					histogram = new Histogram(dataset.getBandCount(), RasterLibrary.defaultNumberOfClasses);
88
					histogram = new Histogram(dataset.getBandCount(), RasterLibrary.defaultNumberOfClasses, dataset.getStatistics().getMinimun(), dataset.getStatistics().getMaximun());
71 89
									
72 90
				return getHistogramByDataType();
73 91
			}

Also available in: Unified diff