Revision 22800 trunk/extensions/extRemoteSensing/src/org/gvsig/remotesensing/mosaic/process/HistogramMatchProcess.java

View differences:

HistogramMatchProcess.java
54 54
import org.gvsig.raster.dataset.NotSupportedExtensionException;
55 55
import org.gvsig.raster.dataset.io.RasterDriverException;
56 56
import org.gvsig.raster.datastruct.Histogram;
57
import org.gvsig.raster.grid.Grid;
58 57
import org.gvsig.raster.grid.filter.RasterFilter;
59 58
import org.gvsig.raster.grid.filter.histogramMatching.HistogramMatchingByteFilter;
60 59
import org.gvsig.raster.util.RasterToolsUtil;
......
66 65
/** 
67 66
 * Clase que implementa el proceso de Histogram Matching para un conjuto de  imagenes
68 67
 * que se quieren hacer corresponder con un histogram de referencia. El proceso tomara como parametros 
69
 * un conjunto de capas y un histograma maestro y ejecutara de forma secuencial un filtro de histogramMatch para cada 
68
 * un conjunto de capas y un histograma maestro y ejecutara de forma secuencial un filtro de histogramMatch 
69
 * para cada una de ellas. El proceso se realiza sobre las bandas de visulaizaci?n.
70
 * 
71
 * @params
72
 * <LI>FLyrRasterSE[] "inputRasterLayers": Capas raster de entrada</LI>
73
 * <LI>Histogram "masterHistogram": Histograma con el que se hace la correspondencia</LI>
74
 * <LI>int "numbandas": PROVISIONAL.</LI>
75
 * <LI>String "outputPath": Ruta completa al fichero de salida del proceso</LI>
76
 * 
77
 * @result
78
 * <LI>outputRassterLayers[]: Capas raster resultantes</LI>
79
 *
70 80
 * par histograma source - histograma referencia.
71 81
 * 
72 82
 * @author aMu?oz (alejandro.mu?oz@uclm.es)
......
93 103
	 * */
94 104
	
95 105
	public void init() {
96
		inputRasterLayers =(FLyrRasterSE []) getParam("layers");
106
		inputRasterLayers =(FLyrRasterSE []) getParam("inputRasterLayers");
97 107
		outputRassterLayers = new FLyrRasterSE[inputRasterLayers.length];
98
		histogramMaster= (Histogram) getParam("histogramMaster");
99
		numbands = ((Integer)getParam("numbands")).intValue();
100
		path = (String) getStringParam("resultsPath");
108
		histogramMaster= (Histogram) getParam("masterHistogram");
109
		numbands = ((Integer)getParam("numbands")).intValue(); //******************************
110
		path = (String) getStringParam("outputPath");
101 111
	}
102 112

  
103 113
	
......
117 127
					IRasterDataSource dsetCopy = null; 
118 128
					dsetCopy = inputRasterLayers[i].getDataSource().newDataset();
119 129
					BufferFactory bufferFactory = new BufferFactory(dsetCopy);
130
					bufferFactory.setDrawableBands(inputRasterLayers[i].getRenderBands());
120 131
					if (!RasterBuffer.loadInMemory(dsetCopy))
121
						bufferFactory.setReadOnly(true);			
122
					Grid g= new Grid(bufferFactory);
123
					filtro.addParam("raster",g.getRasterBuf());
132
						bufferFactory.setReadOnly(true);	
133
					bufferFactory.setAreaOfInterest();
134
					filtro.addParam("raster",bufferFactory.getRasterBuf());
124 135
					filtro.addParam("histogramReference",histogramMaster);
125 136
					filtro.addParam("numbands",new Integer(numbands));
126 137
					filtro.addParam("filterName",new String("histogram"));

Also available in: Unified diff