This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.


Pixel Information tool without text label


hcontrol = impixelinfoval(parentobj,imageobj)


hcontrol = impixelinfoval(parentobj,imageobj) creates a Pixel Information tool in parentobj that provides information about the pixels in the image specified by imageobj. parentobj is a figure or uipanel object. imageobj can be an image object or array of image objects.

The Pixel Information tool displays information about the pixel in an image that the pointer is positioned over. If the figure contains multiple images, the tool displays pixel information for all the images.

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 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 label to the Clipboard, right-click while the pointer is positioned over a pixel. In the context menu displayed, choose Copy pixel info.


Add a Pixel Information 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 graphics object properties.

ankle = dicomread('CT-MONO2-16-ankle.dcm');
h = imshow(ankle,[]);
hText = impixelinfoval(gcf,h);

See also


Introduced before R2006a

Was this topic helpful?