function M = MaxFilterOverDims3and4(M,filterrange)
%don't use padding 
 M = permute(M,[3 4 1 2]);
 for j = 1:size(M,4);
   M(:,:,:,j) = maxfilter(M(:,:,:,j),filterrange);
 end
 M = permute(M,[3 4 1 2]);
  
