| Customize Help
| Save Settings

MmetSetRegion



Function Map
Synopsis
Set the metrology region that delimits the area from which to establish the feature.
Syntax
void MmetSetRegion(
MIL_ID ContextId, //in
MIL_INT FeatureLabelOrIndex, //in
MIL_INT ReferenceFrameLabelOrIndex, //in
MIL_INT64 Geometry, //in
MIL_DOUBLE Param1, //in
MIL_DOUBLE Param2, //in
MIL_DOUBLE Param3, //in
MIL_DOUBLE Param4, //in
MIL_DOUBLE Param5, //in
MIL_DOUBLE Param6 //in
)
Description

This function sets a geometrically-defined ROI, referred to as a metrology region, for a feature within the template of the metrology context. For a physically measured feature, the metrology region delimits the area in the target image from which to establish the edgels of the feature to validate and measure. For a constructed feature, the metrology region delimits the area in the feature itself, which is used as the base feature to build the constructed feature.

When you call this function, you can define the metrology region in one of the following ways.

  • Explicitly specify the shape and size of the region. This is referred to as an explicitly-defined metrology region.

  • Set the region's shape and size using a graphic in a 2D graphics list. This is referred to as a 2D graphics list metrology region.

  • Define the metrology region based on other features by passing a derived metrology region object to this function. This is referred to as a derived metrology region.

When using a 2D graphics list metrology region (M_FROM_GRAPHIC_LIST), the 2D graphics list must contain only one graphic and it must have the same geometric-shape as specified with the Geometry parameter of this function. The advantage of defining a 2D graphics list metrology region is that you can set it with respect to the relative coordinate system as well as set it interactively.

When using a derived metrology region (M_FROM_DERIVED_GEOMETRY_REGION), you must allocate a derived metrology region object using MmetAlloc() with M_DERIVED_GEOMETRY_REGION, and then set it up using MmetControl() with M_REGION_.... Once you specify the geometry of the derived metrology region using the M_REGION_GEOMETRY control type, you can set most of the geometry's attributes either explicitly or derive them based on a feature. Use the corresponding M_REGION_..._TYPE control type to specify which. For example, instead of specifying explicit X- and Y-coordinates to set the position of a rectangular metrology region, you can derive its position according to the position of a point feature.

The metrology region that you choose must be compatible with the geometry and operation of the feature you are adding, with MmetAddFeature(). For example, to add a physically measured circle feature that is built using a best fit operation, you can use an M_RING metrology region.

The metrology region is set according to its feature's reference frame (ReferenceFrameLabelOrIndex). The global frame is the default. If the target image is not calibrated, the global frame's default origin (0,0) is aligned with the center of the top-left corner pixel of the target image. If the target image is calibrated, the global frame's default origin is aligned with the origin of the relative (world) coordinate system. To change the reference frame to a local frame, use MmetControl() with M_REFERENCE_FRAME. Local frames are coordinate systems located anywhere within the metrology template and defined as metrology features.

A valid feature must not only fall within the metrology region, but its edgels' gradient angle must also fall along the region's orientation. Various control types can be used to set a valid relationship between the metrology region's orientation, and the edgels' gradient angle. For more information, see the Gradient angle subsection of the Degrees of freedom section of Chapter 18: Metrology.

Note that you cannot specify a geometrically-defined region for a feature with a region of interest (ROI) set using MbufSetRegion(); you can only use metrology regions established with this function.

Note that when using a C compiler (not a C++ or other compiler) in 64-bit mode, MmetSetRegion() internally calls the MIL_DOUBLE version of this function (MmetSetRegionDouble()). If you need to pass integer values, call the MIL_INT64 version of this function (MmetSetRegionInt64()).
Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
ContextId

Specifies the identifier of the metrology context containing the template in which to set the metrology region. The metrology context must have been previously allocated on the required system using MmetAlloc().

FeatureLabelOrIndex

Specifies the label or index of the feature that will be established from the area delimited by the metrology region. Set this parameter to one of the following values.

function map For specifying a feature
Click to summarizeValue Description
Click to summarize

Specifies the index of an existing individual feature.

(summarize)
Parameters

This parameter specifies the index of the feature to establish from the metrology region. You can set this parameter to the following:

Value >= 0

Specifies the index.

Click to summarize

Specifies the label value of an existing individual feature.

(summarize)
Parameters

This parameter specifies the label of the feature to establish from the metrology region. You can set this parameter to the following:

Value > 0

Specifies the label.

ReferenceFrameLabelOrIndex

Specifies the label or index of the reference frame feature of the feature for which you are specifying a metrology region. To change the reference frame, use MmetControl() with M_REFERENCE_FRAME.

function map For specifying the reference frame
Click to summarizeValue Description
Click to summarize M_DEFAULT

Same as M_GLOBAL_FRAME.

Click to summarize

Specifies the index value of an existing reference frame feature.

(summarize)
Parameters

This parameter specifies the index of the reference frame feature. You can set this parameter to the following:

Value >= 0

Specifies the index. Note that the index of the global frame is 0.

Click to summarize

Specifies the label value of an existing reference frame feature.

(summarize)
Parameters

This parameter specifies the label of the reference frame feature. You can set this parameter to the following:

Value > 0

Specifies the label.

Click to summarize M_GLOBAL_FRAME

Specifies the global frame as the reference frame.

Geometry INQ

Specifies the geometric shape of the metrology region.

See the Parameter associations section for possible values that can be specified.

Param1

Specifies an attribute of the metrology region to set. Its definition is dependent on the geometry chosen.

See the Parameter associations section for possible values that can be specified.

Param2

Specifies an attribute of the metrology region to set. Its definition is dependent on the geometry chosen.

Set this parameter to M_NULL if not used.

See the Parameter associations section for possible values that can be specified.

Param3

Specifies an attribute of the metrology region to set. Its definition is dependent on the geometry chosen.

Set this parameter to M_NULL if not used.

See the Parameter associations section for possible values that can be specified.

Param4

Specifies an attribute of the metrology region to set. Its definition is dependent on the geometry chosen.

Set this parameter to M_NULL if not used.

See the Parameter associations section for possible values that can be specified.

Param5

Specifies an attribute of the metrology region to set. Its definition is dependent on the geometry chosen.

Set this parameter to M_NULL if not used.

See the Parameter associations section for possible values that can be specified.

Param6

Specifies an attribute of the metrology region to set. Its definition is dependent on the geometry chosen.

Set this parameter to M_NULL if not used.

See the Parameter associations section for possible values that can be specified.

The tables below list possible values for the Geometry, Param1, Param2, Param3, Param4, Param5, and Param6 parameters.

The following can be specified for setting an explicitly-defined metrology region. To specify a 2D graphics list metrology region, you must add M_FROM_GRAPHIC_LIST to the supported geometry (M_ARC, M_RECTANGLE, and M_SEGMENT).

Unused parameters should be set to M_NULL.

function map For setting an explicitly-defined or 2D graphics list metrology region
Click to summarizeGeometry Description
Param1
Param2
Param3
Param4
Param5
Param6
Click to summarize M_DEFAULT

Same as M_INFINITE.

(summarize)
Click to summarize M_ARC +

Specifies that the feature will be established from an arc metrology region.

M_ARC can be used to establish point (M_POINT) features.

(summarize)
Click to summarize Param1

Sets the X-coordinate of the origin of the arc metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0.

Click to summarize Value

Specifies the origin's X-coordinate, in pixel or world units.

Click to summarize Param2

Sets the Y-coordinate of the origin of the arc metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0.

Click to summarize Value

Specifies the origin's Y-coordinate, in pixel or world units.

Click to summarize Param3

Sets the radius of the arc metrology region. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0 pixels.

Click to summarize Value

Specifies the radius, in pixel or world units.

Click to summarize Param4

Sets the start angle of the arc metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0°.

Click to summarize 0.0 <= Value <= 360.0

Specifies the angle, in degrees.

Click to summarize Param5

Sets the end angle of the arc metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 360.0°.

Click to summarize 0.0 <= Value <= 360.0

Specifies the angle, in degrees.

Click to summarize M_INFINITE

Specifies that the feature will be established from an infinite metrology region. An infinite metrology region is an X- Y-plane with no boundaries. Use Param3 to specify the angle that defines the orientation of this region. Note that M_INFINITE is similar to M_RECTANGLE, however a rectangular metrology region has a width and a height, which are used to bind the metrology region.

M_INFINITE can be used to establish any feature and is the default metrology region.

(summarize)
Click to summarize Param1

Sets the X-coordinate of the origin of the infinite metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0.

Click to summarize Value

Specifies the origin's X-coordinate, in pixel or world units.

Click to summarize Param2

Sets the Y-coordinate of the origin of the infinite metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0.

Click to summarize Value

Specifies the origin's Y-coordinate, in pixel or world units.

Click to summarize Param3

Sets the angle (orientation) of the infinite metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0°. This indicates that the orientation of the infinite metrology region is the same as the orientation of the reference frame.

(summarize)
Click to summarize M_RADIAL

Specifies that the infinite metrology region has a radial orientation, from 0.0° to 360.0°, based on the specified origin.

In such a metrology region, edgels can only be considered part of the feature if their gradient angle conforms to the direction of a radii pointing out from the region's origin. M_RADIAL is usually used to define a metrology region for a physically measured circular feature whose radius is unknown. Typically the origin of the metrology region is placed at the feature's center, resulting in valid edgels only being possible if they encircle the origin.

(summarize)
Click to summarize 0.0 <= Value <= 360.0

Specifies the angle, in degrees, relative to the reference frame. This angle represents the infinite region's orientation.

(summarize)
Click to summarize M_RECTANGLE +

Specifies that the feature will be established from a rectangular metrology region.

Note that M_RECTANGLE is similar to M_INFINITE, however an infinite metrology region does not have a width and a height (boundaries).

M_RECTANGLE can be used to establish segment (M_SEGMENT) or edgel (M_EDGEL) features.

(summarize)
Click to summarize Param1

Sets the X-coordinate of the origin of the rectangular metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0.

Click to summarize Value

Specifies the origin's X-coordinate, in pixel or world units.

Click to summarize Param2

Sets the Y-coordinate of the origin of the rectangular metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0.

Click to summarize Value

Specifies the origin's Y-coordinate, in pixel or world units.

Click to summarize Param3

Sets the width of the rectangle. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0 pixels.

Click to summarize Value

Specifies the rectangle's width, in pixel or world units.

Click to summarize Param4

Sets the height of the rectangle. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0 pixels.

Click to summarize Value

Specifies the rectangle's height, in pixel or world units.

Click to summarize Param5

Sets the angle (orientation) of the rectangular metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0°.

Click to summarize 0.0 <= Value <= 360.0

Specifies the angle, in degrees.

Click to summarize M_RING

Specifies that the feature will be established from a ring-shaped metrology region.

M_RING can be used to establish circle (M_CIRCLE) or edgel (M_EDGEL) features.

(summarize)
Click to summarize Param1

Sets the X-coordinate of the center of the ring-shaped metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0.

Click to summarize Value

Specifies the origin's X-coordinate, in pixel or world units.

Click to summarize Param2

Sets the Y-coordinate of the center of the ring-shaped metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0.

Click to summarize Value

Specifies the origin's Y-coordinate, in pixel or world units.

Click to summarize Param3

Sets the start radius of the ring-shaped metrology region. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0 pixels.

Click to summarize Value

Specifies the start radius, in pixel or world units.

Click to summarize Param4

Sets the end radius of the ring-shaped metrology region. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0 pixels.

Click to summarize Value

Specifies the end radius, in pixel or world units.

Click to summarize M_RING_SECTOR

Specifies that the feature will be established from a ring-sector metrology region.

M_RING_SECTOR can be used to establish radial segments (M_SEGMENT), arcs (M_ARC), or edgel (M_EDGEL) features.

(summarize)
Click to summarize Param1

Sets the X-coordinate of the origin of the ring-sector metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0.

Click to summarize Value

Specifies the origin's X-coordinate, in pixel or world units.

Click to summarize Param2

Sets the Y-coordinate of the origin of the ring-sector metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0.

Click to summarize Value

Specifies the origin's Y-coordinate, in pixel or world units.

Click to summarize Param3

Sets the start radius of the ring-sector metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0 pixels.

Click to summarize Value

Specifies the start radius, in pixel or world units.

Click to summarize Param4

Sets the end radius of the ring-sector metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0 pixels.

Click to summarize Value

Specifies the end radius, in pixel or world units.

Click to summarize Param5

Sets the start angle of the ring-sector metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0°.

Click to summarize 0.0 <= Value <= 360.0

Specifies the angle, in degrees.

Click to summarize Param6

Sets the end angle of the ring-sector metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 360.0°.

Click to summarize 0.0 <= Value <= 360.0

Specifies the angle, in degrees.

Click to summarize M_SEGMENT +

Specifies that the feature will be established from a linear segment metrology region.

M_SEGMENT can be used to establish point (M_POINT) features.

(summarize)
Click to summarize Param1

Sets the X-coordinate of the start point of the segment metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0.

Click to summarize Value

Specifies the start point's X-coordinate, in pixel or world units.

Click to summarize Param2

Sets the Y-coordinate of the start point of the segment metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0.

Click to summarize Value

Specifies the start point's Y-coordinate, in pixel or world units.

Click to summarize Param3

Sets the X-coordinate of the end point of the segment metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0.

Click to summarize Value

Specifies the end point's X-coordinate, in pixel or world units.

Click to summarize Param4

Sets the Y-coordinate of the end point of the segment metrology region, relative to the reference frame. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0.

Click to summarize Value

Specifies the end point's Y-coordinate, in pixel or world units.

Combination value for M_ARC; M_RECTANGLE; M_SEGMENT.

You can add the following value to the above-mentioned values to set a 2D graphics list metrology region.

Unused parameters should be set to M_NULL.

function map For setting a 2D graphics list metrology region
Click to summarizeGeometry Description
Param1
Param2
Param3
Param4
Param5
Param6
Click to summarize M_FROM_GRAPHIC_LIST

Specifies a 2D graphics list metrology region. Interactive graphics are allowed. Metrology ignores a graphic's fill color, if specified.

When using M_FROM_GRAPHIC_LIST with M_ARC, the 2D graphics list must contain only one arc, created using MgraArc(), MgraArcAngle(), or MgraArcFill(). The arc must be circular; that is, its X- and Y-radius must be the same.

When using M_FROM_GRAPHIC_LIST with M_RECTANGLE, the 2D graphics list must contain only one rectangle, created using MgraRect(), MgraRectAngle(), or MgraRectFill().

When using M_FROM_GRAPHIC_LIST with M_SEGMENT, the 2D graphics list must contain only one line, created using MgraLine().

(summarize)
Click to summarize Param1

Sets the identifier of the 2D graphics list with which to delimit the metrology region. The 2D graphics list must have been previously allocated on the required system using MgraAllocList().

The graphic's data (not the graphic itself) is taken as-is and is considered part of the metrology context with which it is used. For example, the graphic's metrology region information is now relative to the feature's reference frame (ReferenceFrameLabelOrIndex), is saved with the metrology context (MmetSave()), and is not affected by subsequent 2D graphics list modifications unless you re-call M_FROM_GRAPHIC_LIST.

When using a 2D graphics list metrology region, you can first call McalFixture() with M_MOVE_RELATIVE and M_RESULT_MET, and specify the feature's reference frame. You can then ensure that positions are set and returned according to the specified reference frame. For more information, see the Moving using a metrology reference frame subsection of the Moving the relative coordinate system section of Chapter 27: Fixturing in MIL.

(summarize)

The following can be specified for setting a derived metrology region.

Unused parameters should be set to M_NULL.

function map For setting a derived metrology region
Click to summarizeGeometry Description
Param1
Param2
Param3
Param4
Param5
Param6
Click to summarize M_FROM_DERIVED_GEOMETRY_REGION

Specifies a derived metrology region. To set up this metrology region, use MmetControl() with M_REGION_....

It is only recommended to use a derived metrology region when you need at least one other feature to set the metrology region. However, you can use a derived metrology region to set the metrology region using features, explicit values, or a combination of the two. Once you define this type of metrology region, the region information (not the derived metrology region object itself) is considered part of the metrology context with which it is used; for example, that information will be saved along with the context if you call MmetSave().

You can use M_FROM_DERIVED_GEOMETRY_REGION with any geometry.

(summarize)
Click to summarize Param1

Sets the identifier of the derived metrology region object. The derived metrology region object must have been previously allocated on the required system using MmetAlloc() with M_DERIVED_GEOMETRY_REGION.

(summarize)
Type-specific versions of the function when using a C compiler under 64-bit
void MmetSetRegionInt64 (MIL_ID ContextId, MIL_INT FeatureLabelOrIndex, MIL_INT ReferenceFrameLabelOrIndex, MIL_INT64 Geometry, MIL_INT64 Param1, MIL_DOUBLE Param2, MIL_DOUBLE Param3, MIL_DOUBLE Param4, MIL_DOUBLE Param5, MIL_DOUBLE Param6)
Parameters

ContextId

See ContextId of the main function for a description.

FeatureLabelOrIndex

See FeatureLabelOrIndex of the main function for a description.

ReferenceFrameLabelOrIndex

See ReferenceFrameLabelOrIndex of the main function for a description.

Geometry

See Geometry of the main function for a description.

Param1

See Param1 of the main function for a description.

Param2

See Param2 of the main function for a description.

Param3

See Param3 of the main function for a description.

Param4

See Param4 of the main function for a description.

Param5

See Param5 of the main function for a description.

Param6

See Param6 of the main function for a description.

void MmetSetRegionDouble (MIL_ID ContextId, MIL_INT FeatureLabelOrIndex, MIL_INT ReferenceFrameLabelOrIndex, MIL_INT64 Geometry, MIL_DOUBLE Param1, MIL_DOUBLE Param2, MIL_DOUBLE Param3, MIL_DOUBLE Param4, MIL_DOUBLE Param5, MIL_DOUBLE Param6)
Parameters

ContextId

See ContextId of the main function for a description.

FeatureLabelOrIndex

See FeatureLabelOrIndex of the main function for a description.

ReferenceFrameLabelOrIndex

See ReferenceFrameLabelOrIndex of the main function for a description.

Geometry

See Geometry of the main function for a description.

Param1

See Param1 of the main function for a description.

Param2

See Param2 of the main function for a description.

Param3

See Param3 of the main function for a description.

Param4

See Param4 of the main function for a description.

Param5

See Param5 of the main function for a description.

Param6

See Param6 of the main function for a description.

Compilation information
Header Include mil.h.
Library Use mil.lib; milmetrol.lib.
DLL Requires mil.dll; milmetrol.dll.
CONSTRUCTED EDGEL CLONE FEATURE CONSTRUCTED FIT INNER FIT OUTER FIT MEASURED DEFAULT GLOBAL FRAME DEFAULT ARC DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT INFINITE DEFAULT DEFAULT DEFAULT RADIAL RECTANGLE DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT RING DEFAULT DEFAULT DEFAULT DEFAULT RING SECTOR DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT SEGMENT DEFAULT DEFAULT DEFAULT DEFAULT FROM GRAPHIC LIST FROM DERIVED GEOMETRY REGION