function immax=maxfilt(imw,filtersize);

% immax=MAXFILT(im,filtersize);
%
% 		Maximum filters the image file IMW
%
%		filtersize: size of quadratic pixel neighborhood
%
%		e.g.: immax=maxfilt(imw,3);
%
%
% University of Rhode Island
% Dept. of Electrical Engineering
% Roger Meier, May '99


if filtersize < 2
	disp('filter size too small')
	break
end

immax=ordfilt2(imw,filtersize^2,ones(filtersize,filtersize));
