Skip to content

Commit

Permalink
Update filter_variance_skimage_napari.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tischi authored Jul 8, 2024
1 parent 0e6ab53 commit 4614aac
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions _includes/filter_neighbourhood/filter_variance_skimage_napari.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,11 @@
# thus we introduce a, very useful, generic approach to compute any kind of local neighborhood
# filter

# import the function
# import the generic filter function
from scipy.ndimage import generic_filter

# define a function that computes one value from an array of data
def local_variance(data):
value = np.var(data)
return value

# apply this function locally to image
var_image = generic_filter(uint16_image, function=local_variance, size=11)
# apply the generic filter with a variance computation
var_image = generic_filter(uint16_image, function=np.var, size=11)

# %%
# View the variance filtered the image to napari
Expand Down

0 comments on commit 4614aac

Please sign in to comment.