public Kmean(int height, int width, int dimension, Color[][] colorMap) throws MyExceptions {
		MyNotPositiveNumberException.test("row + 1", height + 1);
		MyNotPositiveNumberException.test("column + 1", width + 1);
		MyNotPositiveNumberException.test("dimension + 1", dimension + 1);
		if(colorMap != null) {
			MyNotEqualNumberException.test("height", height, "colorMap.length", colorMap.length);
			MyNotEqualNumberException.test("width", width, "colorMap[0].length", colorMap[0].length);
		}
		this.colorMap = colorMap;
		this.height = height;
		this.width = width;
		this.dimension = dimension;
		values = new float[height][width][dimension];
		for(int i = 0; i < height; ++i)
			for(int j = 0; j < width; ++j)
				for(int k = 0; k < dimension; ++k)
					values[i][j][k] = 0.0f;
		K = 2;
		threshold = 0.1f;
		oldCenters = null;
		newCenters = null;
		groups = new int[height][width];
		for(int i = 0; i < height; ++i)
			for(int j = 0; j < width; ++j)
				groups[i][j] = -1;
		if(colorMap == null)
		color = new Color[]{new Color(51, 153, 255), new Color(51, 153, 102), new Color(51, 0, 102), new Color(204, 102, 0), new Color(204, 255, 102)
							, new Color(204, 153, 153), new Color(255, 0, 204), new Color(102, 102, 51), new Color(102, 102, 102), new Color(0, 51, 0)
							, new Color(51, 153, 0), new Color(51, 0, 0), new Color(51, 0, 153), new Color(51, 0, 255), new Color(51, 255, 0)
							, new Color(51, 255, 102), new Color(51, 255, 153), new Color(51, 255, 255), new Color(255, 255, 255), new Color(0, 0, 0)};
		windowInit();
	}