Essentially, this is something similar to scipy.ndimage.filters.generic_filter (which is too slow because of its internal python for-loop), but implemented in cython as with skimage.filter.rank family.

Given the diversity within skimage.filter.rank, a generic function would be very useful. For example, I'd like to calculate local variance, which is conceptually similar to skimage.filter.rank.mean, but not supported currently.

I guess the absence of such a function must be due to some unresolved technical obstacle?