Image Processing Toolbox User's Guide |
Pixel information tool without the text label
Syntax
Description
creates a pixel information tool in hparent that provides information about the pixels in the image specified by himage. hparent is a handle to a figure or uipanel object. himage can be a handle to an image or an array of image handles.hcontrol
= impixelinfoval(hparent,himage)
The pixel information tool displays information about the pixel in an image that the cursor is positioned over. The tool displays pixel information for all the images in a figure.
When created with impixelinfo
, the tool is a uipanel object, positioned in the lower-left corner of the figure, that contains the text label "Pixel Info:" followed by the the x- and y-coordinates of the pixel and its value. When created with impixelinfoval
, the tool is a uicontrol object positioned in the lower-left corner of the figure, that displays the pixel information without the text label, as shown in the following figure.
The information displayed depends on the image type. See impixelinfo
for details.
To copy the pixel value string to the clipboard, right-click while the cursor is positioned over a pixel. In the context menu displayed, choose Copy pixel info.
Example
This example shows how to add a pixel value tool to a figure. Note how you can change the style and size of the font used to display the value in the tool using standard Handle Graphics commands.
ankle = dicomread('CT-MONO2-16-ankle.dcm'); h = imshow(ankle,[]); hText = impixelinfoval(gcf,h); set(hText,'FontWeight','bold') set(hText,'FontSize',10)
See also
impixelinfo | impixelregion |
© 1994-2005 The MathWorks, Inc.