Build Custom Image Processing Apps Using Modular Interactive Tools

The toolbox includes several modular interactive tools that you can activate from the command line and use with images displayed in a MATLAB® figure window, called the target image in this documentation. The tools are modular because they can be used independently or in combination to create custom image processing apps.

The following table lists the modular tools in alphabetical order. The table includes an illustration of each tool and the function you use to create it.

Note

The Image Processing Toolbox™ image viewing and exploration app, Image Tool, uses these modular tools — see Interact with Images Using Image Viewer App.

Summary of Modular Tools

Modular ToolExampleDescription

Adjust Contrast tool

Displays a histogram of the target image and enables interactive adjustment of contrast and brightness by manipulation of the display range.

Use the imcontrast function to create the tool in a separate figure window and associate it with an image.

Choose Colormap tool

Allows you to change the colormap of the target figure. You can select one of the MATLAB colormaps, select a colormap variable from the MATLAB workspace, or enter a custom MATLAB expression.

Use the imcolormaptool function to launch the tool in a separate figure window.

Crop Image tool

Displays a draggable, resizable rectangle on an image. You can move and resize the rectangle to define the crop region. Double-click to perform the crop operation or select Crop Image from the context menu.

Use the imcrop function to create the tool and associate it with an image.

Display Range tool

Displays the display range values of the associated image.

Use the imdisplayrange function to create the tool, associate it with an image, and embed it in a figure or uipanel.

Distance tool

Displays a draggable, resizable line on an image. Superimposed on the line is the distance between the two endpoints of the line. The distance is measured in units specified by the XData and YData properties, which is pixels by default.

Use the imdistline function to create the tool and associate it with an image.

Image Information tool

Displays basic attributes about the target image. If the image displayed was specified as a graphics file, the tool displays any metadata that the image file might contain.

Use the imageinfo function to create the tool in a separate figure window and associate it with an image.

Magnification box

Creates a text edit box containing the current magnification of the target image. Users can change the magnification of the image by entering a new magnification value.

Use immagbox to create the tool, associate it with an image, and embed it in a figure or uipanel.

Note

The target image must be contained in a scroll panel.

Overview tool

Displays the target image in its entirety with the portion currently visible in the scroll panel outlined by a rectangle superimposed on the image. Moving the rectangle changes the portion of the target image that is currently visible in the scroll panel.

Use imoverview to create the tool in a separate figure window and associate it with an image.

Use imoverviewpanel to create the tool in a uipanel that can be embedded within another figure or uipanel.

Note

The target image must be contained in a scroll panel.

Pixel Information tool

Displays information about the pixel the mouse is over in the target image.

Use impixelinfo to create the tool, associate it with an image, and display it in a figure or uipanel.

If you want to display only the pixel values, without the Pixel info label, use impixelinfoval.

Pixel Region tool

Display pixel values for a specified region in the target image.

Use impixelregion to create the tool in a separate figure window and associate it with an image.

Use impixelregionpanel to create the tool as a uipanel that can be embedded within another figure or uipanel.

Save Image tool

Display the Save Image dialog box. Use this to specify the name of an output image and choose the file format used to store the image.

Use imsave to create the tool in a separate figure window and associate it with an image.

Scroll Panel tool

Display target image in a scrollable panel.

Use imscrollpanel to add a scroll panel to an image displayed in a figure window.