int setVoxelRange(int index, float min, float max, float ptsPerAngstrom, int gridMax) {
		float range = max - min;
		int nGrid;
		if (resolution != Float.MAX_VALUE) {
			ptsPerAngstrom = resolution;
			nGrid = (int) (range * ptsPerAngstrom);
		}
		else {
			nGrid = (int) (range * ptsPerAngstrom);
		}
		if (nGrid > gridMax) {
			if ((dataType & HAS_MAXGRID) > 0) {
				if (resolution != Float.MAX_VALUE)
					Logger.info("Maximum number of voxels for index=" + index);
				nGrid = gridMax;
			}
			else if (resolution == Float.MAX_VALUE) {
				nGrid = gridMax;
			}
		}
		ptsPerAngstrom = nGrid / range;
		float d = volumetricVectorLengths[index] = 1f / ptsPerAngstrom;
		voxelCounts[index] = nGrid + ((dataType & IS_SOLVENTTYPE) != 0 ? 3 : 0);

		switch (index) {
		case 0:
			volumetricVectors[0].set(d, 0, 0);
			volumetricOrigin.x = min;
			break;
		case 1:
			volumetricVectors[1].set(0, d, 0);
			volumetricOrigin.y = min;
			break;
		case 2:
			volumetricVectors[2].set(0, 0, d);
			volumetricOrigin.z = min;
			if (isEccentric)
				eccentricityMatrix.transform(volumetricOrigin);
			if (center.x != Float.MAX_VALUE)
				volumetricOrigin.add(center);
		}
		if (isEccentric)
			eccentricityMatrix.transform(volumetricVectors[index]);
		unitVolumetricVectors[index].normalize(volumetricVectors[index]);
		return voxelCounts[index];
	}