| MIL 10 Reference
| Customize Help
| Save Settings

MregSetLocation



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Synopsis
Sets the rough location of the specified registration element's image with respect to another registration element's image or the global pixel coordinate system.
Syntax
void MregSetLocation(
MIL_ID ContextId, //in
MIL_INT Index, //in
MIL_INT Target, //in
MIL_INT64 ParamType, //in
MIL_DOUBLE Param1, //in
MIL_DOUBLE Param2, //in
MIL_DOUBLE Param3, //in
MIL_DOUBLE Param4, //in
MIL_INT64 ControlFlag //in
)
Description

This function sets the rough location of the specified registration element's image with respect to another registration element's image or the global pixel coordinate system. The MregCalculate() function uses this location to find the transformations that optimally position the images in the global pixel coordinate system.

You can explicitly specify the rough location or you can copy it from a registration element of another registration context or a result element of a registration result buffer. When copying the rough location, you can use the same reference index as the element from which you are copying the rough location. Alternatively, you can specify a different reference index.

The more precise the information, the faster the registration calculation will be. If you know the exact position of the image, you can bypass the optimization step of the calculation by either disabling the MregControl() M_OPTIMIZE_LOCATION control type or replacing the image in the array by M_NULL (see the Skipping the optimization step subsection of the Customizing your registration settings section of Chapter 9: Registration). In this case, the transformation that you specify using MregSetLocation() becomes the optimal transformation. Upon calling MregCalculate(), this transformation will be converted so that it maps the image into the global pixel coordinate system without first converting it into its reference image's pixel coordinate system.

Some restrictions apply when selecting the image's reference. The settings cannot be circularly defined. If you take a specific image and look at its reference, and then at its reference image's reference, and continue through the series of images linked in this manner, the first image must never appear as another image's reference. Furthermore, there should only be one image with its reference set to the global pixel coordinate system.

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 if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
ContextId

Specifies the registration context of the registration element to affect. The registration context must have been previously allocated on the required system using MregAlloc().

Index

Specifies the index of the registration element. This parameter can be set to one of the following:

function map For specifying the index
CollapseValue Description
Collapse M_ALL

Specifies that all of the registration elements will have their location set.

Collapse 0 <= Value <= Number of source elements-1

Specifies the index of the registration element.

Target INQ

Specifies the reference of the registration element's image. The coordinate system associated with this reference is used as the reference coordinate system.

function map For specifying the reference
CollapseValue Description
Collapse M_DEFAULT

Same as M_PREVIOUS.

Collapse M_COPY

Uses the same index as the reference of the element from which positional information is being copied. This setting is only available if the ParamType parameter is set to either M_COPY_REG_CONTEXT or M_COPY_REG_RESULT.

(summarize)
Collapse M_NEXT

Specifies the reference to be the image associated with the registration element whose index follows the specified registration element's index. When the registration element's image is the last one in the input sequence, the reference is set to M_REGISTRATION_GLOBAL, the global pixel coordinate system.

(summarize)
Collapse M_PREVIOUS

Specifies the reference to be the image associated with the registration element whose index precedes the specified registration element's index. When the registration element has an index 0, the reference is set to M_REGISTRATION_GLOBAL, the global pixel coordinate system.

(summarize)
Collapse M_REGISTRATION_GLOBAL

Specifies that the reference is the global pixel coordinate system.

Collapse M_UNCHANGED

Specifies that only the rough locations are changed; the same reference is used.

Collapse 0 <= Value <= Number of source elements-1

Specifies the index of the registration element of the reference image.

ParamType INQ

Specifies the type of transformation to use to set the location of the registration element's image.

Set this parameter to M_DEFAULT if not used.

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

Param1 INQ

Specifies an attribute of the transformation. Its definition depends on the value of ParamType.

Set this parameter to M_DEFAULT if not used.

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

Param2 INQ

Specifies an attribute of the transformation. Its definition depends on the value of ParamType.

Set this parameter to M_DEFAULT if not used.

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

Param3 INQ

Specifies an attribute of the transformation. Its definition depends on the value of ParamType.

Set this parameter to M_DEFAULT if not used.

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

Param4

Reserved for future expansion and must be set to M_DEFAULT.

ControlFlag

Reserved for future expansion and must be set to M_DEFAULT.

The table below lists possible values for the ParamType, Param1, Param2, and Param3 parameters.

Note that any unused parameters should be set to M_DEFAULT.

function map For specifying the transformation type
CollapseParamType Description
Param1
Param2
Param3
Collapse M_COPY_REG_CONTEXT

Specifies that the rough locations are copied from another registration context.

(summarize)
Collapse Param1

Specifies the identifier of the registration context from which to copy the transformation settings.

(summarize)
Collapse Param2

Specifies the registration element index from which to copy the transformation settings.

(summarize)
Collapse M_DEFAULT

Specifies the default index. The default index is the same as the one specified for the Index parameter.

If the Index parameter is set to M_ALL, the function copies each rough location from the source context into the corresponding index in the destination context. In this case, the number of elements in the source registration context passed to Param1 must be greater than or equal to the number of elements in the destination registration context. Any extra elements in the source context will not be copied.

(summarize)
Collapse 0 <= Value <= Number of source elements-1

Specifies the registration element's index.

Collapse M_COPY_REG_RESULT

Specifies that the transformation between two registration result elements is copied.

(summarize)
Collapse Param1

Specifies the identifier of the registration result buffer from which to copy the transformations.

(summarize)
Collapse Param2

Specifies the registration result element's index from which to copy the transformation settings.

(summarize)
Collapse M_DEFAULT

Specifies the default index. The default index is the same as the one specified for the Index parameter.

(summarize)
Collapse 0 <= Value <= Number of source elements-1

Specifies the registration result element's index.

Collapse Param3

Specifies the registration result element's index of the target transformation element.

(summarize)
Collapse M_DEFAULT

Specifies that the target registration result element's index is the same as the one that is specified in the Target parameter.

Collapse M_REGISTRATION_GLOBAL

Specifies that the target registration result element's reference is the global pixel coordinate system.

Collapse Value >= 0

Specifies the target registration result element's index.

Collapse M_POSITION_XY

Specifies the coordinates of the origin of the registration element's image in the coordinate system of its reference. Note that when the reference is an image, the specified coordinates need not lie within the reference image.

(summarize)
Collapse Param1

Sets the X-coordinate of the image's origin in its reference coordinate system.

Collapse Param2

Sets the Y-coordinate of the image's origin in its reference coordinate system.

Collapse M_POSITION_XY_ANGLE

Specifies the coordinates of the origin and the angle of the registration element's image in the coordinate system of its reference. Note that when the reference is an image, the specified coordinates need not lie within the reference image.

(summarize)
Collapse Param1

Sets the X-coordinate of the image's origin in its reference coordinate system.

Collapse Param2

Sets the Y-coordinate of the image's origin in its reference coordinate system.

Collapse Param3

Sets the angle of the image in its reference coordinate system. The angle is measured in degrees in counter-clockwise direction.

(summarize)
Collapse M_WARP_4_CORNER

Specifies the transformation that transforms an arbitrary quadrilateral in the current image's pixel coordinate system into a rectangle in its reference coordinate system. You specify the transformation by supplying 4 points in the current image and 2 points in the reference image.

(summarize)
Collapse Param1

Specifies the MIL identifier of the buffer to use to store the coordinates of the 6 points. This buffer should have an M_ARRAY attribute. For more information on the buffer and its contents, see MgenWarpParameter().

(summarize)
Collapse M_WARP_4_CORNER_REVERSE

Specifies the transformation that transforms a rectangle in the current image's pixel coordinate system into an arbitrary quadrilateral in its reference coordinate system. You specify the transformation by supplying 2 points in the current image and 4 points in the reference image.

(summarize)
Collapse Param1

Specifies the MIL identifier of the buffer to use to store the coordinates of the 6 points needed to warp the image. This buffer should have an M_ARRAY attribute. For more information on the buffer and its contents, see MgenWarpParameter().

(summarize)
Collapse M_WARP_POLYNOMIAL

Specifies the transformation matrix that transforms points in the reference coordinate system into points in the current image's pixel coordinate system.

(summarize)
Collapse Param1

Specifies the MIL identifier of the buffer containing the transformation matrix. For more information on the buffer and its contents, see MimWarp().

(summarize)
Type-specific versions of the function
void MregSetLocationInt64 (MIL_ID ContextId, MIL_INT Index, MIL_INT Target, MIL_INT64 ParamType, MIL_INT64 Param1, MIL_DOUBLE Param2, MIL_DOUBLE Param3, MIL_DOUBLE Param4, MIL_INT64 ControlFlag)
Parameters

ContextId

See ContextId of the main function for a description.

Index

See Index of the main function for a description.

Target

See Target of the main function for a description.

ParamType

See ParamType 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.

ControlFlag

See ControlFlag of the main function for a description.

Compilation information
Header Include mil.h.
Library Use mil.lib; milreg.lib.
DLL Requires mil.dll; milreg.dll.
ALL DEFAULT COPY NEXT PREVIOUS REGISTRATION GLOBAL UNCHANGED COPY REG CONTEXT DEFAULT COPY REG RESULT DEFAULT DEFAULT REGISTRATION GLOBAL POSITION XY POSITION XY ANGLE WARP 4 CORNER WARP 4 CORNER REVERSE WARP POLYNOMIAL FLOAT