Main Content

imdisplayrange

Display Range tool

Description

Use the imdisplayrange function to create a Display Range tool. The Display Range tool shows the display range of the grayscale image or images in the figure.

Display Range tool displaying a two-element numeric vector whose values vary with data type.

example

imdisplayrange creates a Display Range tool in the current figure.

imdisplayrange(h) creates a Display Range tool in the figure that contains graphics object h.

imdisplayrange(hParent,hImage) creates a Display Range tool in the figure or panel hParent. The tool shows the display range of the image in hImage.

hTool = imdisplayrange(___) returns the panel hTool containing the Display Range tool.

Examples

collapse all

Display an image and include the Display Range tool.

imshow("bag.png")
imdisplayrange;

Bag image with the Display Range tool visible

Import a 16-bit DICOM image and display it with its default range and scaled range in the same figure.

dcm = dicomread("CT-MONO2-16-ankle.dcm");
subplot(1,2,1), imshow(dcm)
subplot(1,2,2), imshow(dcm,[])
imdisplayrange;

Unscaled and scaled DICOM image side by side in a figure window with the Display Range tool visible

Input Arguments

collapse all

Graphics object, specified as a Figure, Axes, or Image object. Figure and axes objects must contain at least one image object.

If h is a figure, then the parent of the Display Range tool is h. Otherwise, the parent of the Display Range tool is the figure that is an ancestor of h.

Parent of the Display Range tool, specified as a Figure or Panel object.

Images, specified as an Image object or an array of Image objects.

Output Arguments

collapse all

Display Range tool, returned as a Panel object.

Tips

  • The Display Range tool is a panel object that is positioned in the lower-right corner of the figure. The tool contains the label Display range: followed by the display range values for the image.

  • For an indexed, truecolor, or binary image, the display range is not applicable and is set to empty ([]).

  • The Display Range tool can work with multiple images in a figure. When the pointer is not in an image in a figure, the Display Range tool displays [black white].

Version History

Introduced before R2006a