imaqConstructROI2

NI Vision for LabWindows/CVI Function

imaqConstructROI2

Usage

int imaqConstructROI2(const Image* image, ROI* roi, Tool initialTool, const ToolWindowOptions* tools, const ConstructROIOptions2* options, int* okay);

Purpose

Displays the image in a modal window and allows the user to draw a region of interest (ROI) on it. After the user draws the ROI, the function closes the window.

Image Types Supported

IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL, IMAQ_IMAGE_COMPLEX, IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL

Parameters

Name

Type

Description

image const Image* Specifies the image that the user selects an ROI from.
roi ROI* Specifies the ROI that initially appears in the ROI constructor window. The user can then modify this ROI by adding, removing, resizing, and moving contours. The function applies the results of these modifications to the ROI.
initialTool Tool Specifies the initially selected tool in the ROI constructor window. This tool must be available in the ROI constructor window.
tools const ToolWindowOptions* Determines the availability of tools in the ROI constructor window. Set tools to NULL to display all the tools.
options const ConstructROIOptions2* Describes how a function presents the ROI constructor window.
okay int* Upon return, this parameter is TRUE if the user pressed OK to end the selection of a line. Otherwise, this parameter is FALSE. Set this parameter to NULL if you do not need this information.

Return Value

Type

Description

int On success, this function returns a non-zero value. On failure, this function returns 0. To get extended error information, call imaqGetLastError().

Parameter Discussion

options—Set options to NULL to use the default options, as follows:

windowNumber IMAQ_MODAL_DIALOG
windowTitle "ROI Constructor"
type IMAQ_PALETTE_GRAY
palette NULL
numColors 0
maxContours 1