Skip to content

Commit

Permalink
#34 Added docstrings to the gauss_kernel function.
Browse files Browse the repository at this point in the history
  • Loading branch information
carljohnsen committed Sep 17, 2024
1 parent 8c82445 commit f976465
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lib/py/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,21 @@ def generate_cylinder_mask(nx):
return rs <= 1

def gauss_kernel(sigma):
'''
Create a 1D Gaussian kernel with a given sigma.
It mimics the kernel created in `scipy.ndimage.gaussian_filter1d`.
Parameters
----------
`sigma` : float
The standard deviation of the Gaussian.
Returns
-------
`kernel` : numpy.array[float]
The 1D Gaussian kernel.
'''

radius = round(4.0 * sigma) # stolen from the default scipy parameters
# Deprecated:
#kernel = ndi.filters._gaussian_kernel1d(sigma_voxels, 0, radius).astype(internal_type)
Expand Down

0 comments on commit f976465

Please sign in to comment.