docs: def immerkaer(input, mode="reflect", cval=0.0):
      r"""
      Estimate the global noise.
      
      The input image is assumed to have additive zero mean Gaussian noise. Using a
      convolution with a Laplacian operator and a subsequent averaging the standard
      deviation sigma of this noise is estimated. This estimation is global i.e. the
      noise is assumed to be globally homogeneous over the image.
      
      Implementation based on [1]_.
      
          
      Immerkaer suggested a Laplacian-based 2D kernel::
      
          [[ 1, -2,  1],
           [-2,  4, -1],
           [ 1, -2, 1]]
  
      , which is separable and can therefore be applied by consecutive convolutions with
      the one dimensional kernel [1, -2, 1].
      
      We generalize from this 1D-kernel to an ND-kernel by applying N consecutive
      convolutions with the 1D-kernel along all N dimensions.
      
      This is equivalent with convolving the image with an ND-kernel constructed by calling
      
      >>> kernel1d = numpy.asarray([1, -2, 1])
      >>> kernel = kernel1d.copy()
      >>> for _ in range(input.ndim):
      >>>     kernel = numpy.tensordot(kernel, kernel1d, 0)
      
      Parameters
      ----------
      input : array_like
          Array of which to estimate the noise.
      mode : {'reflect', 'constant', 'nearest', 'mirror', 'wrap'}, optional
          The `mode` parameter determines how the array borders are
          handled, where `cval` is the value when mode is equal to
          'constant'. Default is 'reflect'
      cval : scalar, optional
          Value to fill past edges of input if `mode` is 'constant'. Default
          is 0.0        
          
      Returns
      -------
      sigma : float
          The estimated standard deviation of the images Gaussian noise.
          
      Notes
      -----
      Does not take the voxel spacing into account.
      Works good with medium to strong noise. Tends to underestimate for low noise levels.
          
      See also
      --------
      immerkaer_local
      
      References
      ----------
      .. [1] John Immerkaer, "Fast Noise Variance Estimation", Computer Vision and Image
             Understanding, Volume 64, Issue 2, September 1996, Pages 300-302, ISSN 1077-3142
      """
      # build nd-kernel to acquire square root of sum of squared elements
      kernel = [1, -2, 1]
      for _ in range(input.ndim - 1):
          kernel = numpy.tensordot(kernel, [1, -2, 1], 0)
      divider = numpy.square(numpy.abs(kernel)).sum() # 36 for 1d, 216 for 3D, etc.
      
      # compute laplace of input and derive noise sigma
      laplace = separable_convolution(input, [1, -2, 1], None, mode, cval)
      factor = numpy.sqrt(numpy.pi / 2.) * 1. / ( numpy.sqrt(divider) * numpy.prod(laplace.shape) )
      sigma = factor * numpy.abs(laplace).sum()
      
      return sigma