%
% function imdispband( img, band, colorspace[, map]);
%
%          to display a channel 'BAND' of an image 'IMG' 
%          that is in a color space 'COLORSPACE' with a color map 'MAP'
%
%          IMG: a multi-band image (3-D matrix of size Y*X*C)
%          BAND: the channel number to display (int, i.e. 2)
%          COLORSPACE: the space the image is expressed (i.e. 'yuv')
%          MAP: an appropriate color map (double matrix of size CR*3)
%
%          NOTICE: At present, the function assumes that the 1st channel
%                  is either the Red or the Luminance so it is shown unchanged!
%
%          Dependencies: IMDISP, COLORMAP, COLORMATRIX, CONVERTCOLORSPACE
%


%
% Copyright © 05-Jan-2004 George P. Pavlidis® (gpavlid@ceti.gr, gpavlid@ee.duth.gr)
%
function imdispband( img, band, colorspace, map);

	if band==1,
		imdisp( img(:,:,1), 1, 1);
		if exist('map','var'), colormap( map); end;
	else
		c = zeros( size( img));
		img(:,:,1) = 0;
		img( :,:,iif( band==2,3,2)) = 0;
		imdisp( eval( ['convertcolorspace(img,colormatrix(''',colorspace,'2rgb''))']), 1, 1);
		if exist('map','var'), colormap( map); end;
	end;