Mercurial > hg > camir-aes2014
comparison core/tools/uimagesc.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function h = uimagesc(varargin) | |
2 %UIMAGESC Display scaled image with uneven axis. | |
3 % UIMAGESC(...) is the same as UIMAGE(...) except the data is scaled | |
4 % to use the full colormap. See UIMAGE for details. | |
5 % | |
6 % Note: UIMAGESC is based on Matlab's original IMAGESC, Revision 5.11.4.5. | |
7 % UIMAGESC simply calls UIMAGE with a scaled colormap. | |
8 % | |
9 % F. Moisy - adapted from TMW | |
10 % Revision: 1.01, Date: 2006/06/13. | |
11 % | |
12 % See also IMAGE, IMAGESC, UIMAGE. | |
13 | |
14 % History: | |
15 % 2006/06/12: v1.00, first version. | |
16 | |
17 clim = []; | |
18 switch (nargin), | |
19 case 0, | |
20 hh = uimage('CDataMapping','scaled'); | |
21 case 1, | |
22 hh = uimage(varargin{1},'CDataMapping','scaled'); | |
23 case 3, | |
24 hh = uimage(varargin{:},'CDataMapping','scaled'); | |
25 otherwise, | |
26 | |
27 % Determine if last input is clim | |
28 if isequal(size(varargin{end}),[1 2]) | |
29 str = false(length(varargin),1); | |
30 for n=1:length(varargin) | |
31 str(n) = ischar(varargin{n}); | |
32 end | |
33 str = find(str); | |
34 if isempty(str) || (rem(length(varargin)-min(str),2)==0), | |
35 clim = varargin{end}; | |
36 varargin(end) = []; % Remove last cell | |
37 else | |
38 clim = []; | |
39 end | |
40 else | |
41 clim = []; | |
42 end | |
43 hh = uimage(varargin{:},'CDataMapping','scaled'); | |
44 end | |
45 | |
46 % Get the parent Axes of the image | |
47 cax = ancestor(hh,'axes'); | |
48 | |
49 if ~isempty(clim), | |
50 set(cax,'CLim',clim) | |
51 elseif ~ishold(cax), | |
52 set(cax,'CLimMode','auto') | |
53 end | |
54 | |
55 if nargout > 0 | |
56 h = hh; | |
57 end |