code: def dilate(f, B):
      from numpy import maximum, newaxis, ones, int32
  
      h, w = f.shape
      x, v = mat2set(B)
      mh, mw = max(abs(x)[:, 0]), max(abs(x)[:, 1])
      y = (ones((h + 2 * mh, w + 2 * mw), int32) * limits(f)[0]).astype(
          f.dtype
      )
      for i in range(x.shape[0]):
          if v[i] > -2147483647:
              y[
                  mh + x[i, 0] : mh + x[i, 0] + h,
                  mw + x[i, 1] : mw + x[i, 1] + w,
              ] = maximum(
                  y[
                      mh + x[i, 0] : mh + x[i, 0] + h,
                      mw + x[i, 1] : mw + x[i, 1] + w,
                  ],
                  add4dilate(f, v[i]),
              )
      y = y[mh : mh + h, mw : mw + w]
      return y
  
file_path: mahotas/mahotas/tests/pymorph_copy.py
imports: import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: dilate(f, B) and returns: y