Home > utils > uimagesc.m

uimagesc

PURPOSE ^

UIMAGESC Display scaled image with uneven axis.

SYNOPSIS ^

function h = uimagesc(varargin)

DESCRIPTION ^

UIMAGESC  Display scaled image with uneven axis.
   UIMAGESC(...) is the same as UIMAGE(...) except the data is scaled
   to use the full colormap. See UIMAGE for details.

   Note: UIMAGESC is based on Matlab's original IMAGESC, Revision 5.11.4.5.
   UIMAGESC simply calls UIMAGE with a scaled colormap.
 
   F. Moisy - adapted from TMW
   Revision: 1.01,  Date: 2006/06/13.

   See also IMAGE, IMAGESC, UIMAGE.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function h = uimagesc(varargin)
0002 %UIMAGESC  Display scaled image with uneven axis.
0003 %   UIMAGESC(...) is the same as UIMAGE(...) except the data is scaled
0004 %   to use the full colormap. See UIMAGE for details.
0005 %
0006 %   Note: UIMAGESC is based on Matlab's original IMAGESC, Revision 5.11.4.5.
0007 %   UIMAGESC simply calls UIMAGE with a scaled colormap.
0008 %
0009 %   F. Moisy - adapted from TMW
0010 %   Revision: 1.01,  Date: 2006/06/13.
0011 %
0012 %   See also IMAGE, IMAGESC, UIMAGE.
0013 
0014 % History:
0015 % 2006/06/12: v1.00, first version.
0016 
0017 clim = [];
0018 switch (nargin),
0019   case 0,
0020     hh = uimage('CDataMapping','scaled');
0021   case 1,
0022     hh = uimage(varargin{1},'CDataMapping','scaled');
0023   case 3,
0024     hh = uimage(varargin{:},'CDataMapping','scaled');
0025   otherwise,
0026 
0027     % Determine if last input is clim
0028     if isequal(size(varargin{end}),[1 2])
0029       str = false(length(varargin),1);
0030       for n=1:length(varargin)
0031         str(n) = ischar(varargin{n});
0032       end
0033       str = find(str);
0034       if isempty(str) || (rem(length(varargin)-min(str),2)==0),
0035         clim = varargin{end};
0036         varargin(end) = []; % Remove last cell
0037       else
0038         clim = [];
0039       end
0040     else
0041       clim = [];
0042     end
0043     hh = uimage(varargin{:},'CDataMapping','scaled');
0044 end
0045 
0046 % Get the parent Axes of the image
0047 cax = ancestor(hh,'axes');
0048 
0049 if ~isempty(clim),
0050   set(cax,'CLim',clim)
0051 elseif ~ishold(cax),
0052   set(cax,'CLimMode','auto')
0053 end
0054 
0055 if nargout > 0
0056     h = hh;
0057 end

Generated on Sun 24-Mar-2019 04:00:51 by m2html © 2003