function [X,cm] = comboc(m1,m2)
% [X,cm] = combo(m1,m2)
%
%       Displays image of m1 with non-zero elements of m2 overlayed in red
%
% On input:
%          m1: matrix whose gray levels will be shown
%          m2: matrix whose non-zero values show as red overlay
% On output:
%           X: RGB image
%          cm: colormap for X
%
Rmap=[1,0,1,0,1,0,1];
Gmap=[0,1,1,0,0,1,1];
Bmap=[0,0,0,1,1,1,1];
dim = max(max(m1));
I = mat2gray(m1,[0 dim]);
[X,map] = gray2ind(I,dim);
[bR, bG, bB] = ind2rgb(X,map);

[m n] = size(m2);
for ii = 1:m
 for jj = 1:n
  val = m2(ii,jj);
  if val>0
	val = val-fix(val/7)*7+1;
	bR(ii,jj) = Rmap(val); bG(ii,jj) = Gmap(val); bB(ii,jj) =Bmap(val);
  end
 end
end
[X, cm] = rgb2ind(bR,bG,bB,64);
clf;
imshow(X,cm);
