Patch median filter

Still not sure of how I use the flag in MedianFilter.cxx, otherwise I think I went through all the changes needed.