function g = getcol(a,i0,j0)
%
% getcol: return the indexes to the neighbors of (i0,j0) which are ~=0
% On input:
%    a:     2D array of labeled ridge segments
%    i0:    i index of starting point
%    j0:    j index of starting point
% On output:
%     g:	    indexes of non-zero column neighbors of (i0,j0)
% Call:
%     g = getcol(a,i0,j0)
%
% Authors:	Tom Henderson
%		Univ of Utah
%		8 Sept 1996
%

[m,n] = size(a);
g = [i0,j0];
i1 = i0-1;
while i1>0
  if a(i1,j0)>0
    g = [g; i1,j0];
    i1 = i1-1;
  else
    i1 = 0;
  end
end
i1 = i0+1;
while i1<=m
  if a(i1,j0)>0
    g = [g; i1,j0];
    i1 = i1+1;
  else
    i1 = m+1;
  end
end
