Home > SaliencyToolbox > displayMaps.m

displayMaps

PURPOSE ^

displayMaps - displays a set of maps in the current figure.

SYNOPSIS ^

function displayMaps(maps,varargin)

DESCRIPTION ^

 displayMaps - displays a set of maps in the current figure.

 displayMaps(maps)
    Displays all maps in the array of maps (cell or normal array) 
    in the current figure.

 displayMaps(maps,normalizeFlag)
    If normalizeFlag is 1, the maps are maximum-normalized,
    if it is 2, then the maps are max-normalized and scaled
    to the dimensions of map.origImage (default: 1).

 See also displayMap, displayPyramid, dataStructures, showImage

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % displayMaps - displays a set of maps in the current figure.
0002 %
0003 % displayMaps(maps)
0004 %    Displays all maps in the array of maps (cell or normal array)
0005 %    in the current figure.
0006 %
0007 % displayMaps(maps,normalizeFlag)
0008 %    If normalizeFlag is 1, the maps are maximum-normalized,
0009 %    if it is 2, then the maps are max-normalized and scaled
0010 %    to the dimensions of map.origImage (default: 1).
0011 %
0012 % See also displayMap, displayPyramid, dataStructures, showImage
0013 
0014 % This file is part of the SaliencyToolbox - Copyright (C) 2006-2013
0015 % by Dirk B. Walther and the California Institute of Technology.
0016 % See the enclosed LICENSE.TXT document for the license agreement.
0017 % More information about this project is available at:
0018 % http://www.saliencytoolbox.net
0019 
0020 function displayMaps(maps,varargin)
0021 
0022 if (isempty(varargin)) normalizeFlag = 1;
0023 else normalizeFlag = varargin{1}; end
0024 
0025 numMaps = numel(maps);
0026 subDims(1) = ceil(sqrt(numMaps));
0027 subDims(2) = ceil(numMaps / subDims(1));
0028 
0029 if iscell(maps)
0030   sz = size(maps{1}.data);
0031   if (sz(1) < sz(2))
0032     w = min(subDims);
0033     h = max(subDims);
0034   else
0035     w = max(subDims);
0036     h = min(subDims);
0037   end
0038 
0039   if (numMaps == 1)
0040     set(gcf,'Name',maps{1}.label);
0041   end
0042 
0043   for m = 1:numMaps
0044     subplot(h,w,m);
0045     displayMap(maps{m},normalizeFlag);
0046   end
0047 else
0048   sz = size(maps(1).data);
0049   if (sz(1) < sz(2))
0050     w = min(subDims);
0051     h = max(subDims);
0052   else
0053     w = max(subDims);
0054     h = min(subDims);
0055   end
0056   
0057   if (numMaps == 1)
0058     set(gcf,'Name',maps(1).label);
0059   end
0060 
0061   for m = 1:numMaps
0062     subplot(h,w,m);
0063     displayMap(maps(m),normalizeFlag);
0064   end
0065 end

Generated on Thu 18-Jul-2013 06:10:46 by m2html © 2005