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=[0,1,0,1,0,1,0,1];
Gmap=[0,0,1,1,0,0,1,1];
Bmap=[0,0,0,0,1,1,1,1];
dim = max(max(m1));
[m,n]=size(m2);

I = mat2gray(m1,[0 dim]);
[X,map] = gray2ind(I,dim);
[bR, bG, bB] = ind2rgb(X,map);
m2= m2-fix(m2/7)*7+1+sign(m2);
bR=max(bR,reshape(Rmap(m2),m,n));
bG=max(bG,reshape(Gmap(m2),m,n));
bB=max(bB,reshape(Bmap(m2),m,n));

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