comparison scripts/image/imshow.m @ 13705:2da28f71de80

Undo accidental change in 13704:6f779cc391fb
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Fri, 14 Oct 2011 17:33:20 -0500
parents 6f779cc391fb
children 7ee61e56eaed
comparison
equal deleted inserted replaced
13704:6f779cc391fb 13705:2da28f71de80
113 else 113 else
114 error ("imshow: argument number %d is invalid", narg+1); 114 error ("imshow: argument number %d is invalid", narg+1);
115 endif 115 endif
116 endwhile 116 endwhile
117 117
118 ## Check for complex images.
119 if (iscomplex (im))
120 warning ("imshow: only showing real part of complex image");
121 im = real (im);
122 endif
123
124 ## Set default display range if display_range not set yet. 118 ## Set default display range if display_range not set yet.
125 if (isempty (display_range)) 119 if (isempty (display_range))
126 display_range = [min(im(:)), max(im(:))]; 120 display_range = [min(im(:)), max(im(:))];
127 elseif (isna (display_range)) 121 elseif (isna (display_range))
128 t = class (im); 122 t = class (im);
134 otherwise 128 otherwise
135 error ("imshow: invalid data type for image"); 129 error ("imshow: invalid data type for image");
136 endswitch 130 endswitch
137 endif 131 endif
138 132
133 ## Check for complex images.
134 if (iscomplex (im))
135 warning ("imshow: only showing real part of complex image");
136 im = real (im);
137 endif
138
139 nans = isnan (im(:)); 139 nans = isnan (im(:));
140 if (any (nans)) 140 if (any (nans))
141 warning ("Octave:imshow-NaN", 141 warning ("Octave:imshow-NaN",
142 "imshow: pixels with NaN or NA values are set to minimum pixel value"); 142 "imshow: pixels with NaN or NA values are set to minimum pixel value");
143 im(nans) = display_range(1); 143 im(nans) = display_range(1);