function mask = linkshow(p,a)
%
% linkshow - generate link mask w/ Bresenham line
% On input:
%     p: band properties matrix
%     a: labeled image
% On output:
%     mask: overlay mask of link edges
% Call:
%     mask = linkshow(p,a);
%

[numsegs,dummy] = size(p);
[m,n] = size(a);
mask = zeros(m,n);
CROW = 1; CCOL = 2;
for s1 = 1:numsegs
  s1row = p(s1,CROW); s1col = p(s1,CCOL);
  for i1 = 4:6
    s2 = p(s1,i1);
    if s1 ~= s2
      s2row = p(s2,CROW); s2col = p(s2,CCOL);
      mask = drawline(mask,s1col,s1row,s2col,s2row);
    end;
  end;
end;
