Main Content

iptsetpref

Set Image Processing Toolbox preference or display valid values

Description

example

iptsetpref(prefname) displays the valid values for the Image Processing Toolbox™ preference specified by prefname.

iptsetpref(prefname,prefvalue) sets the Image Processing Toolbox preference specified by prefname to the value specified by prefvalue. The setting persists until you change it.

You can also use the Image Processing Toolbox Preferences window to set preferences. To access the window, on the Home tab, in the Environment section, click Preferences button Preferences. Alternatively, open the Preferences window by calling the iptprefs function.

Examples

collapse all

Set the default borders of the imshow function to tight.

iptsetpref("ImshowBorder","tight")

Input Arguments

collapse all

Name of an Image Processing Toolbox preference, specified as one of the values in the table. Preference names are case insensitive, and you can abbreviate them.

Image Processing Toolbox Preferences

Preference Name

Description

"ImshowAxesVisible"

Controls whether imshow displays images with the axes box and tick labels. Possible values:

"on" — Include axes box and tick labels.

"off" — Do not include axes box and tick labels. This is the default value.

"ImshowBorder"

Controls whether imshow includes a border around the image in the figure window. Possible values:

"loose" — Include a border between the image and the edges of the figure window, leaving room for annotations such as axes labels and titles. This is the default value.

"tight" — Adjust the figure size so that the image entirely fills the figure.

Note

You can include a border even if the image is very small, or if there are other objects in the figure besides the image and its axes.

You can override this preference by specifying the Border name-value argument when you call imshow.

"ImshowInitialMagnification"

Controls the initial magnification of the image displayed by imshow. Possible values:

Positive numeric scalar — imshow interprets numeric values as a percentage. The default value is 100. A magnification of 100% means that there should be one screen pixel for every image pixel.

"fit" — Scale the image so that it fits into the window in its entirety.

You can override this preference by specifying the InitialMagnification name-value argument when you call imshow, or by calling the truesize function after displaying the image.

"ImtoolInitialMagnification"

Controls the initial magnification of the image displayed by the Image Tool. Possible values:

"adaptive" — Display the entire image. If the image is too large to display on the screen at 100% magnification, display the image at the largest magnification that fits on the screen. This is the default value.

Positive numeric scalar — Specify the magnification as a percentage. A magnification of 100% means that there should be one screen pixel for every image pixel.

"fit" — Scale the image so that it fits into the window in its entirety.

You can override this preference by specifying the InitialMagnification name-value argument when you open the Image Tool using the imtool function.

"ImtoolStartWithOverview"

Controls whether the Overview tool opens automatically when you open an image using the Image Tool using the imtool. Possible values:

true — Overview tool opens when you open an image.

false — Overview tool does not open when you open an image. This is the default value.

"VolumeViewerUseHardware"

Controls whether the Volume Viewer app uses OpenGL® shaders on the local graphics hardware to optimize volume rendering. Possible values:

true — Enable hardware optimization. This is the default value.

false — Disable hardware optimization. A false value removes certain functionality from the app and reduces rendering performance. Set this preference to false only in technical support scenarios, to resolve problems with graphics drivers.

Note

This preference is not accessible in the Preferences window, and must be set programmatically using iptsetpref.

"UseIPPL"

Controls whether some toolbox functions use hardware optimization or not. Possible values:

true — Enable hardware optimization. This is the default value.

false — Disable hardware optimization

Note

Setting this preference clears all loaded MEX files.

Data Types: string | char

Value to assign to an Image Processing Toolbox preference, specified as a valid value for the specified preference. The values for each preference are listed in the table in prefname.

Example: iptsetpref("ImshowBorder","tight")

Version History

Introduced before R2006a