public int moore(int i, int j, int r ) {
		int sum = 0;
		int imax = this.length;
		int jmax = this.width;
		for (int n = 0; n <= 2*r; n++){
			for (int m = 0; m <= 2*r; m++){
				int ii = topo.idI(i - r + n, j - r + m, imax, jmax);
				int jj = topo.idJ(i, j - r + m, imax, jmax);
				if ( (!(ii < 0) && !(ii >= imax)) && (!(jj < 0) && !(jj >= jmax)) && (ii != i || jj != j )) {
					sum += this.getCell(ii,jj).toBit();
				}
			}

		}
		return sum;
	}