code: def findinputslice(coord, sliceshape, sheetshape):
          
          center_row, center_col = coord
          n_rows, n_cols = sliceshape
          sheet_rows, sheet_cols = sheetshape
  
          c1 = -min(0, center_col-n_cols/2)  # assuming odd shape (n_cols/2)
          r1 = -min(0, center_row-n_rows/2)  # top and bottom
          c2 = -max(-n_cols, center_col-sheet_cols-n_cols/2)
          r2 = -max(-n_rows, center_row-sheet_rows-n_rows/2)
  
          return (r1, r2, c1, c2)
docs: Gets the matrix indices of a slice within an array of size
          sheetshape from a sliceshape, positioned at coord.