Image Processing Toolbox Release Notes Previous page   Next Page

Updates to the imshow Function

There have been several changes to the behavior and syntaxes supported by the imshow function. The following sections describe these changes.

Filenames No Longer Displayed as a Title in Figure Window Border

The imshow function when called with a filename

no longer automatically displays the filename as a title in the figure window border. In previous releases, the gray space was proportional to image size. Often, this left too little space for small images and too much for big images, making positioning the title in the figure window problematic.

Changes to the algorithm imshow uses to calculate the border size when the 'ImshowBorder' preference is set to 'loose' should allow plenty of room for title, axes tick marks, and axes labels in a way that is independent of the image size. (See New Image Display Range Syntax for more information.)

Nondefault Spatial Coordinate Syntax Changed

The imshow syntax for specifying nondefault spatial coordinates has changed to use parameter/value pairs. The old syntax

is now

imshow still accepts the old syntax, automatically translating it to the new syntax and issuing the following warning.

Initial Image Magnification DISPLAY_OPTION Syntax Changed

The imshow display_option syntax is obsolete. The old syntax,

where display_option was either 'truesize' or 'notruesize', has been replaced by the following parameter/value pair syntax:

As the value, you can specify a numeric magnification percentage value or the text string 'fit'.

imshow still accepts the old syntax, automatically translating the old display_option values to the new syntax, as shown in the following table. The table also includes the text of the warning message issued by imshow.

Old Syntax
Automatic Translation to New Syntax
imshow(...,'truesize')
imshow(...,'InitialMagnification',100)
where 100% magnification specifies the same one-image-pixel to one-screen-pixel magnification achieved by the 'truesize' option. imshow also issues the following warning message.
  • Warning: IMSHOW(...,'truesize') is an obsolete 
    syntax. 
    Use IMSHOW(...,'InitialMagnification',100) instead.
    
imshow(...,'notruesize')
imshow(...,'InitialMagnification','fit')
where the behavior is similar to the 'notruesize' behavior. imshow issues the following warning message.
  • Warning: IMSHOW(...,'notruesize') is an obsolete 
    syntax.
    Use IMSHOW(...,'InitialMagnification','fit') instead.
    

New Image Scaling Algorithm Determines Image Display

When you specify a numeric magnification percentage value, imshow performs the following processing to determine how to display the image.

  1. Calculate the gutter dimensions (gray space around image) and figure window decoration dimensions.

  1. Determine the screen dimensions for the image at the requested display magnification.
  2. Add the results of Step 1 and Step 2.
  3. Determine if the figure fits on the screen at the specified magnification.
  1. If the image in the figure window fits on the screen, display it.

    If the image in the figure window does not fit on the screen, imshow reduces the magnification until the image fits on the screen and displays it. imshow issues a warning message that the image has been scaled, including the magnification value in the message.

New Image Display Range Syntax

The imshow syntax in which you specify the display range of the image

has been augmented to use a parameter/value pair syntax

imshow still accepts the old syntax.

Note, however, that with the new parameter/value syntax, you can specify the target image as a filename, as in the following example.

If you want to specify the display range for an intensity image specified by a filename, you must use the 'DisplayRange' parameter.

Number-of-Gray-Levels Syntax Obsoleted

The imshow syntax in which you specified the number of gray levels used to display the image

has been obsoleted. If you use this syntax, imshow outputs the following warning message:


Previous page  Enhancements and Changes to Existing Features Changes to Toolbox Preferences Next page

© 1994-2005 The MathWorks, Inc.