comparison scripts/image/imshow.m @ 7315:3ceb12c499e9

[project @ 2007-12-13 21:35:36 by jwe]
author jwe
date Thu, 13 Dec 2007 21:35:36 +0000
parents 87151f298e6a
children 359f464342b3
comparison
equal deleted inserted replaced
7314:8e5feea0545a 7315:3ceb12c499e9
147 if (ismember (class (im), {"int8", "int16", "uint32", "int32", "single"})) 147 if (ismember (class (im), {"int8", "int16", "uint32", "int32", "single"}))
148 im = double (im); 148 im = double (im);
149 endif 149 endif
150 150
151 ## Scale the image to the interval [0, 1] according to display_range. 151 ## Scale the image to the interval [0, 1] according to display_range.
152 if (! indexed || islogical (im)) 152 if (! (true_color || indexed || islogical (im)))
153 low = display_range(1); 153 low = display_range(1);
154 high = display_range(2); 154 high = display_range(2);
155 im = (im-low)/(high-low); 155 im = (im-low)/(high-low);
156 im(im < 0) = 0; 156 im(im < 0) = 0;
157 im(im > 1) = 1; 157 im(im > 1) = 1;
158 endif 158 endif
159 159
160 if (true_color) 160 if (true_color)
161 tmp = __img__ ([] , [], im); 161 tmp = __img__ ([], [], im);
162 else 162 else
163 tmp = image (round ((rows (colormap ()) - 1) * im)); 163 tmp = image (round ((rows (colormap ()) - 1) * im));
164 endif 164 endif
165 set (gca (), "visible", "off");
165 166
166 if (nargout > 0) 167 if (nargout > 0)
167 h = tmp; 168 h = tmp;
168 endif 169 endif
169 170