On Fri, Jul 26, 2024 at 8:50 AM <langt...@forwiss.uni-passau.de> wrote:

> Dear all,
>
> my goal would be to apply some function on a local environment of size K x
> K x K where K is bigger than 1 and odd. For example, if K = 3, it would be
> nice to apply some function "func" on such an environment around each
> n-dimensional position within the n-dimensional array. So, for K = 3 and
> the position (1,1,1) if a 3D array, one would collect the array values at
> the positions X = [(0,0,0),(0,0,1),(0,0,2),(0,1,0),...(2,2,2)] (K**3 = 27
> in total in this example) and yield those values to "func". The result
> value at position (1,1,1) in the output array would be y = func(X). The
> same would apply for all entries excluding the padding area (or according
> to some padding policy).
>

scipy.ndimage.generic_filter()
<https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.generic_filter.html>

-- 
Robert Kern
_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to