I have a 512x512x512 numpy array. Is there any efficient way to perform a mean filter where every array value is substituted by all 3x3x3 local values?

We are seeking somethin similar to `scipy.ndimage.filters.median_filter` but insted of median with mean.