code: public void fixRowsAndCols() {
          rows = (int) Math.round((n - s) / ns_res);
          if (rows < 1)
              rows = 1;
          cols = (int) Math.round((e - w) / we_res);
          if (cols < 1)
              cols = 1;
      }
docs: calculate rows and cols from the region and its resolution. Round if required.