title: Boundary modes in scipy.ndimage.laplace
body: <p>The function <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.laplace.html" rel="nofollow noreferrer">scipy.ndimage.laplace</a> can be used to calculate the Laplace operator applied to N-dimensional arrays. If one wants to use this function, for example, for applications in physics, the crucial part is often how to handle the boundaries.</p>
  
  <p>Looking at the function documentation, a number of options are supported:</p>
  
  <ul>
  <li>‘reflect’ (d c b a | a b c d | d c b a)</li>
  <li>‘constant’ (k k k k | a b c d | k k k k)</li>
  <li>‘nearest’ (a a a a | a b c d | d d d d)</li>
  <li>‘mirror’ (d c b | a b c d | c b a)</li>
  <li>‘wrap’ (a b c d | a b c d | a b c d)</li>
  </ul>
  
  <p>One thing I am personally missing is a <strong>'smooth continuation'</strong> option. In the above notation, it would correspond to a slightly modified version of the mirror option:</p>
  
  <ul>
  <li>'smooth continuation' ((a-d) (a-c) (a-b) | a b c d | (d-c) (d-b) (d-a))</li>
  </ul>
  
  <p>The motivation for this is to not introduce kinks at the boundary, which all of the supported options seem to be doing for an arbitrary input.</p>
  
  <p><strong>Question: Is there any way to do this Laplace operation in scipy/numpy?</strong> </p>