These two functions have very similar semantics so it might be worth having a common supporting function here
mapwindow in ImageFiltering generates a new pixel from a square local patch
extremefilt! in ImageMorphology selects an existing pixel from direct neighborhoods
However, I'm not sure if it's possible to implement this efficiently. Such a failure example is JuliaImages/ImageFiltering.jl#225...