function y = mmshow( f, f1, f2, f3, f4, f5, f6 ) % MMSHOW Display binary or gray-scale images and optionally overlay it with binary images. % % Y = MMSHOW( F, F1, F2, F3, F4, F5, F6 ) % % Input: % F - Gray-scale (uint8 or uint16) or binary image (logical uint8). % F1 - Binary image (logical uint8). Red overlay. DEFAULT: No % parameter. % F2 - Binary image (logical uint8). Green overlay. DEFAULT: No % parameter. % F3 - Binary image (logical uint8). Blue overlay. DEFAULT: No % parameter. % F4 - Binary image (logical uint8). Magenta overlay. DEFAULT: No % parameter. % F5 - Binary image (logical uint8). Yellow overlay. DEFAULT: No % parameter. % F6 - Binary image (logical uint8). Cyan overlay. DEFAULT: No % parameter. % % Output: % Y - Gray-scale (uint8 or uint16) or binary image (logical uint8). % Optionally return RGB uint8 image % % Displays the binary (logical uint8) or gray-scale (uint8 or uint16) % image F, and optionally overlay it with up to six binary images % F1 to F6 in the following colors: F1 as red, F2 as green, F3 as % blue, F4 as yellow, F5 as magenta, and F6 as cian. The image is % displayed in the MATLAB figure only if no output parameter is % given. % % Examples % -------- % % f=mmreadgray('mribrain.tif'); % f150=mmthreshad(f,150); % f200=mmthreshad(f,200); % mmshow(f); % mmshow(f150); % mmshow(f,f150,f200); % % % See also MMDTSHOW, MMLBLSHOW, MMSURF. % begin of the default argument automatic treatment % end of the default argument automatic treatment 1 if (nargin < 1) disp('Error, mmshow: needs at least one input image.'); return; end switch nargin case 1, y=mmgshow(f); case 2, y=mmgshow(f,f1); case 3, y=mmgshow(f,f1,f2); case 4, y=mmgshow(f,f1,f2,f3); case 5, y=mmgshow(f,f1,f2,f3,f4); case 6, y=mmgshow(f,f1,f2,f3,f4,f5); case 7, y=mmgshow(f,f1,f2,f3,f4,f5,f6); end if nargout == 0 newFigure=isempty(get(0,'CurrentFigure')) | strcmp(get(get(0,'CurrentFigure'), 'NextPlot'), 'new'); if (newFigure) figHandle = figure('Visible', 'off'); axHandle = axes('Parent', figHandle); else axHandle = newplot; figHandle = get(axHandle, 'Parent'); end image(y,'Parent',axHandle); axis off; set(axHandle,'DataAspectRatio',[1 1 1]); if (length(findobj(axHandle,'Type','image')) <= 1) figKids=allchild(figHandle); kids=[findobj(figKids,'Type','axes') ; findobj(figKids,'Type','uicontrol','Visible','on')]; if (length(kids) <= 1) if (isequal(get(axHandle,'Position'),get(get(axHandle,'Parent'),'DefaultAxesPosition'))) mmtruesize(f); % change the figure size to reflect image size set(figHandle,'NextPlot','replacechildren'); end end end figure(gcf); end % Copyright (c) 1998-2001 by SDC Information Systems.