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