# HG changeset patch # User jwe # Date 1155847258 0 # Node ID 01ff100fcd64dc09292f10ae984e947e893d4e8a # Parent 8702f00329bf158abb07de4f45615385cdbdbf81 [project @ 2006-08-17 20:40:58 by jwe] diff -r 8702f00329bf -r 01ff100fcd64 scripts/image/imshow.m --- a/scripts/image/imshow.m Thu Aug 17 20:31:14 2006 +0000 +++ b/scripts/image/imshow.m Thu Aug 17 20:40:58 2006 +0000 @@ -63,7 +63,7 @@ print_usage (); endif - ## Get the image + ## Get the image. if (ischar (im)) im = loadimage (im); # It would be better to use imread from octave-forge elseif (! ismatrix (im)) @@ -124,7 +124,7 @@ narg++; endwhile - ## Check for complex images + ## Check for complex images. if (iscomplex (im)) warning ("imshow: only showing real part of complex image"); im = real (im); @@ -139,18 +139,17 @@ im(im > 1) = 1; endif - ## Convert to indexed image + ## Convert to indexed image. dim = ndims (im); if (dim == 2) im = round ((size (color_map, 1) - 1) * im); elseif (dim == 3 && size (im, 3) == 3) - [im, color_map] = rgb2ind (im(:,:,1), im(:,:,2), im(:,:,3)); - #[im, color_map] = rgb2ind (im); # Change rgb2ind to support ND-arrays and then use this line + [im, color_map] = rgb2ind (im); else error ("imshow: input image must be a 2D or 3D matrix"); endif - ## And now, we show the image + ## And now, we show the image. colormap (color_map); image (im, initial_magnification/100); colormap (old_colormap);