%
% function show_layers(R)
%
% Given a matrix R \in NxMxQ with Q layers this script shows all the layers
% as different colours.
% 
% Dr. A. I. Hanna (2005);
function I = show_layers(R, axis_handle)
I = R;
% I = zeros([size(R(:,:,1)),3]);
% for i=2:size(R,3)
%     c = round(rand(1,3)*255);
%     I(:,:,1) = I(:,:,1) + R(:,:,i)*c(1);
%     I(:,:,2) = I(:,:,2) + R(:,:,i)*c(2);
%     I(:,:,3) = I(:,:,3) + R(:,:,i)*c(3);
% 
% end
I =I./max(I(:));
if nargout==0
    if nargin<2
        axis_handle = gca;
    end
    imagesc(I, 'Parent', axis_handle);
    axis(axis_handle, 'image', 'ij');
end
return;