ptroi._java


// Region of interest processing

	int numroi				= 0;			// Number of ROIs
	String		roi_im[];
	int			roi_xp[];
	int			roi_yp[];
	boolean		roi_loaded[];


void roi_allocate(int n){
	try{
		roi_im			= new String[n];
		roi_xp			= new int[n];
		roi_yp			= new int[n];
		roi_loaded		= new boolean[n];
		numroi = n;
	}catch(Exception e){
		numroi = 0;
	}
}

void roi_dispose(){
	int i;
	
	for(i=0; i<numroi; i++){
		roi_im[i] = null;
	}
	roi_im = null;
	roi_xp = null;
	roi_yp = null;
	roi_loaded = null;
	numroi = 0;
}

   	void ParseROILine( String s, int n ){
   		int i=0,k,length = s.length();
    	StringBuffer w = new StringBuffer();
   		
   		// Set defaults
   		roi_im[n] = null;
   		roi_xp[n] = 0;
   		roi_yp[n] = 0;
   		roi_loaded[n] = false;
   		
    	while(i<length){
   			switch( s.charAt(i++)){
   				case 'x':i = getNextWord(i,s,w); roi_xp[n] = Integer.parseInt(w.toString());  break;
   				case 'y':i = getNextWord(i,s,w); roi_yp[n] = Integer.parseInt(w.toString());  break;
   				case 'i':i = getNextWord(i,s,w); roi_im[n] = w.toString(); 					  break;	
   			}
   		}
   	}
  		



Back