function im = anticon(c)
%
% anticon: creates image with contours as gray levels from contour plot info
% On input:
%     c: output from contour function
% On output:
%     im: 2D aray with contour info 
% Call:
%     im = anticon(c)
%

[two,n] = size(c);
index = 0;
while index<n
  index = index+1;
  nextval = c(1,index);
  num = c(2,index);
  for i2 = 1:num
    index = index+1;
    im(round(c(2,index)),round(c(1,index))) = nextval;
  end;
end;
