Revision 2130 org.gvsig.raster.principalcomponents/trunk/org.gvsig.raster.principalcomponents/org.gvsig.raster.principalcomponents.algorithm/src/main/java/org/gvsig/raster/principalcomponents/algorithm/PrincipalComponentsProcess.java

View differences:

PrincipalComponentsProcess.java
30 30
	public static final String    BUFFERS            = "BUFFERS";
31 31
	public static final String    SELECTEDPCS        = "SELECTEDPCS";
32 32
	public static final String    PCSTATISTICS       = "PCSTATISTICS";
33
	public static final String    ROI_EPSG           = "ROI_EPSG";
34
	public static final String    EXTENT             = "EXTENT";
35 33
	public static final String    GRAPHIC_DATA       = "GRAPHIC_DATA";
36 34
	public static final String    BANDS              = "BANDS";
37
	public static final String    WINDOW             = "WINDOW";
38 35
	
39 36
	private RasterDataStore       store              = null;
40 37
	private String                filename           = null;
41 38
	
42 39
	private PCStatsDataStructure  pcStatistics       = null;
43 40
	private List<ROI>             rois               = null;
44
	private String                roiEPSG            = null;
45
	private	Extent 				  inputWindow		 = null;
46 41
	private Extent                extentResult       = null;
47 42
	private boolean[]             selectedPCs        = null;
48 43
	private boolean[]             bands              = null;
......
54 49
		registerInputParameter(RASTER_STORE, RasterDataStore.class, PrincipalComponentsAlgorithmLibrary.PC_PROCESS_LABEL);
55 50
		registerInputParameter(PCSTATISTICS, PCStatsDataStructure.class, PrincipalComponentsAlgorithmLibrary.PC_PROCESS_LABEL);
56 51
		registerInputParameter(PATH, String.class, PrincipalComponentsAlgorithmLibrary.PC_PROCESS_LABEL);
57
		registerInputParameter(ROI_EPSG, String.class, PrincipalComponentsAlgorithmLibrary.PC_PROCESS_LABEL);
58 52
		registerInputParameter(SELECTEDPCS, Boolean[].class, PrincipalComponentsAlgorithmLibrary.PC_PROCESS_LABEL);
59 53
		registerInputParameter(BANDS, Boolean[].class, PrincipalComponentsAlgorithmLibrary.PC_PROCESS_LABEL);
60
		registerInputParameter(WINDOW, Extent.class, PrincipalComponentsAlgorithmLibrary.PC_PROCESS_LABEL);
61 54
		
62 55
		registerOutputParameter(FILENAME, String.class, PrincipalComponentsAlgorithmLibrary.PC_PROCESS_LABEL);
63 56
		registerOutputParameter(GRAPHIC_DATA, Double[].class, PrincipalComponentsAlgorithmLibrary.PC_PROCESS_LABEL);
......
69 62
		selectedPCs = (boolean[]) getParam(SELECTEDPCS);
70 63
		bands = (boolean[]) getParam(BANDS);
71 64
		pcStatistics = (PCStatsDataStructure) getParam(PCSTATISTICS);
72
		roiEPSG = getStringParam(ROI_EPSG);
73
		inputWindow = getParam(WINDOW) != null ? (Extent)getParam(WINDOW) : null;
74 65
	}
75 66

  
76 67
	public void process() throws ProcessInterruptedException, ProcessException {
......
79 70
			if (store == null)
80 71
				throw new PrincipalComponentsException(Messages.getText("need_a_input"));
81 72
			
82
			if(roiEPSG != null) {
73
			if(getROIEPSG() != null) {
83 74
				try {
84
					rois = store.getRois(roiEPSG);
75
					rois = store.getRois(getROIEPSG());
85 76
				} catch (ROIException e2) {
86 77
					logger.error(Messages.getText("error_getting_rois"), e2);
87 78
				}
......
93 84
				new PrincipalComponentsException("Error cloning the input DataStore", e);
94 85
			}
95 86
			
96
			extentResult = getExtentResult(inputWindow, rois, store);
87
			extentResult = getExtentResult(getOutputWindow(), rois, store);
97 88
			Rectangle2D sourcePxBBox = getSourcePxBox(extentResult, store);
98 89
			
99 90
			double cellSize = store.getCellSize();

Also available in: Unified diff