title: Inverse of n-dimensional numpy.gradient
body: <p>Does numpy or scipy contain a function which is an inverse of the n-dimensional "gradient" fn?</p>
  
  <p>E.g. if "image" contains a 2D matrix, then i want a function inv_gradient that behaves as follows:</p>
  
  <pre><code>(gx, gy) = numpy.gradient(image)
  constant_vector_0 = image[0,:] - inv_gradient(gx, gy)[0,:]
  constant_vector_1 = image[:,0] - inv_gradient(gx, gy)[:,0]
  image == inv_gradient(gx, gy) + tile(constant_vector_0,(shape(image)[0],1)) + transpose(tile(constant_vector_1,(shape(image)[1],1)))
  </code></pre>