Skip to content

Commit

Permalink
Merge pull request #2891 from hyperspy/RELEASE_next_patch
Browse files Browse the repository at this point in the history
Merge RELEASE_next_patch into RELEASE_next_minor
  • Loading branch information
ericpre committed Feb 22, 2022
2 parents 32b501b + ada6412 commit 84c6d5c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hyperspy/utils/peakfinders2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def _local_stat(image, radius, func):
"""Calculates rolling method 'func' over a circular kernel."""
x, y = np.ogrid[-radius : radius + 1, -radius : radius + 1]
kernel = np.hypot(x, y) < radius
stat = ndi.filters.generic_filter(image, func, footprint=kernel)
stat = ndi.generic_filter(image, func, footprint=kernel)
return stat

def local_mean(image, radius):
Expand All @@ -375,7 +375,7 @@ def local_std(image, radius):
def single_pixel_desensitize(image):
"""Reduces single-pixel anomalies by nearest-neighbor smoothing."""
kernel = np.array([[0.5, 1, 0.5], [1, 1, 1], [0.5, 1, 0.5]])
smoothed_image = ndi.filters.generic_filter(image, _fast_mean, footprint=kernel)
smoothed_image = ndi.generic_filter(image, _fast_mean, footprint=kernel)
return smoothed_image

def stat_binarise(image):
Expand All @@ -390,8 +390,8 @@ def stat_binarise(image):

def smooth(image):
"""Image convolved twice using a uniform 3x3 kernel."""
image = ndi.filters.uniform_filter(image, size=3)
image = ndi.filters.uniform_filter(image, size=3)
image = ndi.uniform_filter(image, size=3)
image = ndi.uniform_filter(image, size=3)
return image

def half_binarise(image):
Expand Down

0 comments on commit 84c6d5c

Please sign in to comment.