%
% RemoveMinorRegions.m
%
% Function removes minor regions in a blob colored image.  Logic one pixels
% in the image that have been labeled as part of the largest blob are
% retained.  Logic one pixels that do not belong to the largest blob
% are set to zero.  
%
% jph 20 April 2002
%   01/20/14: took out loops to make it run faster.  jph
%

function [x] = RemoveMinorRegions(x,size,BlobLabels,BlobCounts)

[junk,MaxCountLabel] = max(BlobCounts);

x(BlobLabels ~= MaxCountLabel) = 0;
    
return;
