public int[] getDegree(int dimension1, int dimension2, int numBins, boolean inDegree) {

		int j = 0;
		int[] Degree = new int[numBins + 1];

		int[][] hist2D = get2DHistogram(dimension1, dimension2, numBins);
		convMap = new HashMap<Integer,List<Integer>>();
		divMap = new  HashMap<Integer,List<Integer>>();

		for (int i = 0; i < hist2D.length; i++) {
			for (j = 0; j < hist2D.length; j++) {

				// int countNumLines= hist2D[i][j];
				if (hist2D[i][j] > 0)

					if (inDegree) {
						// Degree[j]=Degree[j]+countNumLines;
						Degree[j]++;
						List<Integer> listVal = convMap.get(j);

						if (listVal == null)
							convMap.put(j, listVal = new ArrayList<Integer>());

						listVal.add(i);
					} else {
						// Degree[i]=Degree[i]+countNumLines;;
						Degree[i]++;
						List<Integer> listVal = divMap.get(j);

						if (listVal == null)
							divMap.put(i,
									listVal = new ArrayList<Integer>());
						listVal.add(j);
					}
			}
		}

		return Degree;
	}