On the differences between Matlab and AFNI, I think one difference is the medfilt3 function in Matlab uses a rectangular neighborhood while the 3dmerge winsor filter and 3dMedianFilter use spherical neighborhoods. Besides these, also consider 3dLocalstat. Although it's relatively slow, especially with large neighborhoods, it has flexibility for 2D,3D, sphere and rectangular block neighborhoods, so you could potentially do a median filter within-plane only if you like.