function [X,cm] = combo(m1,m2)
%
% combo: 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
% Call:
%      [X,cm] = combo(m1,m2) !
%

dim = max(max(m1));
I = mat2gray(m1,[0 dim]);
if (dim<64) dim=64; end
[X,map] = gray2ind(I,dim);
[bR, bG, bB] = ind2rgb(X,map);

[m n] = size(m2);
for ii = 1:m
 for jj = 1:n
  if m2(ii,jj)>0
	bR(ii,jj) = 1.0; bG(ii,jj) = 0.0; bB(ii,jj) = 0.0;
  end
 end
end

%temp = (m2 > zeros(m,n));
%tbR = (m2 <= zeros(m,n));
%bR = (bR.*tbR) + temp;

%temp = m2~=0;
%bG = bG.*(~temp);
%bB = bB.*(~temp);
%bR = bR.*(~temp)+temp;

[X, cm] = rgb2ind(bR,bG,bB,64);
clf;
imshow(X,cm);
