Skip to content

Commit

Permalink
Add docstring to hminima
Browse files Browse the repository at this point in the history
  • Loading branch information
jni committed Sep 30, 2015
1 parent ccff3fe commit 32b69b3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion gala/morpho.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,20 @@ def morphological_reconstruction(marker, mask, connectivity=1):
return marker

def hminima(a, thresh):
"""Suppress all minima that are shallower than thresh."""
"""Suppress all minima that are shallower than thresh.
Parameters
----------
a : array
The input array on which to perform hminima.
thresh : float
Any local minima shallower than this will be flattened.
Returns
-------
out : array
A copy of the input array with shallow minima suppressed.
"""
maxval = a.max()
ainv = maxval-a
return maxval - morphological_reconstruction(ainv-thresh, ainv)
Expand Down

0 comments on commit 32b69b3

Please sign in to comment.