gaussian_kern_3d

mcalf.utils.smooth.gaussian_kern_3d(width=5, sigma=1, 1, 1)[source]

3D Gaussian kernel.

Create a Gaussian kernel of shape width`*`width`*`width.

Parameters
  • width (int, optional, default=5) – Length of all three dimensions of the Gaussian kernel.

  • sigma (array_like, tuple, optional, default=(1, 1, 1)) – Sigma values for the time, horizontal and vertical dimensions.

Returns

kernel – The generated kernel.

Return type

numpy.ndarray, shape=(width, width, width)

Examples

>>> gaussian_kern_3d(width=3, sigma=(2, 1, 1.5))
array([[[0.42860385, 0.53526143, 0.42860385],
        [0.48567179, 0.60653066, 0.48567179],
        [0.42860385, 0.53526143, 0.42860385]],

       [[0.70664828, 0.8824969 , 0.70664828],
        [0.8007374 , 1.        , 0.8007374 ],
        [0.70664828, 0.8824969 , 0.70664828]],

       [[0.42860385, 0.53526143, 0.42860385],
        [0.48567179, 0.60653066, 0.48567179],
        [0.42860385, 0.53526143, 0.42860385]]])