function [X,cm] = combo2(m1,m2,m3)
%
% combo: displays image of m1 with non-zero elements of m2 overlayed in red
%    and non-zero elements of m3 in blue.  Where both are non-zero, purple
%
% On input:
%          m1: matrix whose gray levels will be shown
%          m2: matrix whose non-zero values show as red overlay
%	   m3: matrix whose non-zero valuse show as blue overlay
% On output:
%           X: RGB image
%          cm: colormap for X
% Call:
%      [X,cm] = combo2(m1,m2,m3)
%

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);

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

% temp = (m3 > zeros(m,n));
% tbB = (m3 <= zeros(m,n));
% bB = (bB.*tbB) + temp;

temp = m2 > 0;
temp2 = m3 > 0;
bG = bG.*(~(temp | temp2));
bB = bG.*(~(temp | temp2)) + temp2;
bR = bR.*(~(temp | temp2)) + temp;


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