impoint
(Not recommended) Create draggable point
impoint
is not recommended. Use the new Point
ROI
object instead. You can also use the new ROI creation convenience function drawpoint
. For more information, see Version History.
Description
An impoint
object encapsulates an interactive point over an
image.
You can adjust the position of the point by using the mouse. The point also has a context menu that controls aspects of its appearance and behavior. For more information, see Usage.
Creation
Syntax
Description
h = impoint
begins interactive placement of a point on
the current axes, and returns an impoint
object.
h = impoint(
begins
interactive placement of a point on the object specified by
hparent
)hparent
.
h = impoint(___,"PositionConstraintFcn",
also specifies where the point can be dragged using a position constraint
function, fcn
)fcn
.
Input Arguments
Properties
Usage
When you call impoint
with an interactive syntax, the pointer
changes to a cross hairs when over the image. Click and drag the mouse to
specify the position of the point. The point supports a context menu that you can use to
control aspects of its appearance and behavior.
The table describes the interactive behavior supported by
impoint
.
Interactive Behavior | Description |
---|---|
Moving the point. | Move the mouse pointer over the point. The mouse pointer changes to a fleur shape . Click and drag the mouse to move the point. |
Changing the color used to display the point. | Move the mouse pointer over the point. Right-click and select Set Color from the context menu and specify the color you want to use. |
Retrieving the coordinates of the point. | Move the mouse pointer over the point. Right-click and select
Copy Position from the context menu to
copy a 1-by-2 array to the clipboard specifying the coordinates of the
point [X Y] . |
Deleting the point | Move the pointer on top of the point. Right-click and select
Delete from the context menu. To remove
this option from the context menu, set the Deletable
property to false: h = impoint(); h.Deletable =
false; |
Object Functions
Each impoint
object supports a number of functions. Type
methods impoint
to see a complete list.
addNewPositionCallback | Add new-position callback to ROI object |
createMask | (Not recommended) Create mask within image |
delete | Delete handle object |
getColor | Get color used to draw ROI object |
getPosition | Return current position of ROI object |
getPositionConstraintFcn | Return function handle to current position constraint function |
removeNewPositionCallback | Remove new-position callback from ROI object |
resume | (Not recommended) Resume execution of MATLAB command line |
setColor | (Not recommended) Set color used to draw ROI object |
setConstrainedPosition | Set ROI object to new position |
setPosition | (Not recommended) Move ROI object to new position |
setPositionConstraintFcn | Set position constraint function of ROI object |
setString | Set text label for point ROI object |
wait | (Not recommended) Block MATLAB command line until ROI creation is finished |
Examples
Tips
If you use impoint
with an axes that contains an image object, and
do not specify a drag constraint function, then users can drag the point outside the
extent of the image and lose the point. When used with an axes created by the
plot
function, the axes limits automatically expand to
accommodate the movement of the point.