public void rescaleCenter(double minLevel, double maxLevel) {
		double maxImage = -Double.MAX_VALUE;
		double minImage =  Double.MAX_VALUE;
		short[] slice;
		for(int z=0; z<nz; z++) {
			slice = (short[])data[z];
			for(int k=0; k<nxy; k++) {
				if ((slice[k] & 0xFFFF) > maxImage) 
					maxImage = slice[k] & 0xFFFF;
				if ((slice[k] & 0xFFFF) < minImage) 
					minImage = slice[k] & 0xFFFF;
			}
		}
		double center = (maxLevel+minLevel)/2.0;
		double a;
		if ( minImage-maxImage == 0) {
			a = 1.0;
			minImage = (maxLevel-minLevel)/2.0;
		}
		else {
			if ( Math.abs(maxImage) > Math.abs(minImage) )
				a = (maxLevel-center) / Math.abs(maxImage);
			else
				a = (center-minLevel) / Math.abs(minImage);
		}
		for(int z=0; z<nz; z++) {
			slice = (short[])data[z];
			for(int k=0; k<nxy; k++) {
				slice[k] = (short)(a*(((double)(slice[k] & 0xFFFF))-minImage) + center);
			}
		}
	}