wolffd@0: function h = uimagesc(varargin) wolffd@0: %UIMAGESC Display scaled image with uneven axis. wolffd@0: % UIMAGESC(...) is the same as UIMAGE(...) except the data is scaled wolffd@0: % to use the full colormap. See UIMAGE for details. wolffd@0: % wolffd@0: % Note: UIMAGESC is based on Matlab's original IMAGESC, Revision 5.11.4.5. wolffd@0: % UIMAGESC simply calls UIMAGE with a scaled colormap. wolffd@0: % wolffd@0: % F. Moisy - adapted from TMW wolffd@0: % Revision: 1.01, Date: 2006/06/13. wolffd@0: % wolffd@0: % See also IMAGE, IMAGESC, UIMAGE. wolffd@0: wolffd@0: % History: wolffd@0: % 2006/06/12: v1.00, first version. wolffd@0: wolffd@0: clim = []; wolffd@0: switch (nargin), wolffd@0: case 0, wolffd@0: hh = uimage('CDataMapping','scaled'); wolffd@0: case 1, wolffd@0: hh = uimage(varargin{1},'CDataMapping','scaled'); wolffd@0: case 3, wolffd@0: hh = uimage(varargin{:},'CDataMapping','scaled'); wolffd@0: otherwise, wolffd@0: wolffd@0: % Determine if last input is clim wolffd@0: if isequal(size(varargin{end}),[1 2]) wolffd@0: str = false(length(varargin),1); wolffd@0: for n=1:length(varargin) wolffd@0: str(n) = ischar(varargin{n}); wolffd@0: end wolffd@0: str = find(str); wolffd@0: if isempty(str) || (rem(length(varargin)-min(str),2)==0), wolffd@0: clim = varargin{end}; wolffd@0: varargin(end) = []; % Remove last cell wolffd@0: else wolffd@0: clim = []; wolffd@0: end wolffd@0: else wolffd@0: clim = []; wolffd@0: end wolffd@0: hh = uimage(varargin{:},'CDataMapping','scaled'); wolffd@0: end wolffd@0: wolffd@0: % Get the parent Axes of the image wolffd@0: cax = ancestor(hh,'axes'); wolffd@0: wolffd@0: if ~isempty(clim), wolffd@0: set(cax,'CLim',clim) wolffd@0: elseif ~ishold(cax), wolffd@0: set(cax,'CLimMode','auto') wolffd@0: end wolffd@0: wolffd@0: if nargout > 0 wolffd@0: h = hh; wolffd@0: end