function a = simridge(al)
%  labels simple ridges 
%      a = simridge(al) 
% 
%   On Input :
%	al     =  Already connected component labeled image
%
%   On Output :
%
%       a      =  Labeled image with components broken up labeled as -1

a = al;
[m,n] = size(al);
for l = 1:max(max(al))
  [als,ioff,joff] = lext(al,l);
  [m1,n1] = size(als);
  for i1 = 1:m1
    for j1 = 1:n1
      if als(i1,j1)>0 
        listr = [];
        [alsr,listr] = delr(als,i1,j1);
        alsrl = labelr8(alsr); 
        maxr = max(max(alsrl)); 
	if maxr>2    % got a break
          [lenr,two] = size(listr); 
          for l1 = 1:lenr
            ind1 = listr(l1,1) + ioff;
            ind2 = listr(l1,2) + joff;
            a(ind1,ind2) = -1;
          end
        else
          listc = [];
          [alsc,listc] = delc(als,i1,j1);
          alscl = labelr8(alsc);
          maxc = max(max(alscl)); 
          if maxc>2
            [lenc,two] = size(listc);
            for l1 = 1:lenc
              ind1 = listc(l1,1) + ioff;
              ind2 = listc(l1,2) + joff;
              a(ind1,ind2) = -1;
            end
          end
        end
      end
    end
  end
end

