RegionParams Table
The RegionParams table contains properties used by the CMeasureRegions class. This table is used to change properties using the class SetParams method.
The reference table below lists the region measurement properties and their update status. For each property in the top half of the table, there exists a corresponding update status flag in the lower half of the table. The name of the update status flag prefixes the property name with the word Set. For example, the property bCentroid has the update status flag bSetCentroid. Normally, the update status flag is set to false. But to change it using the RegionParams table, you must the the status flag to true. Create an RegionParams table containing only the properties you wish to change. Then call the class SetParams method with the RegionParams table as its parameter.
Table Member |
Default |
Definition |
Property: |
|
|
sColor |
"255,0,0" |
The color of the line. See the nRasterOp property. |
nRasterOp |
13 |
Controls the way the line color and image color are combined for drawing. |
nLineThk |
1 |
Sets the thickness of the line, in pixels, drawn on the image. |
bFilled |
true |
Draws the region filled (true) or outlined (false). |
nMatchingTol |
3 |
Sets the tolerance, in pixels, for mouse click "hits" to the line. |
nClosureTol |
3 |
Sets the tolerance, in pixels, for clicking on the endpoint of the polygon. |
nCentroidRadius |
15 |
The centroid radius when the vertex is adjusted to the centroid coordinates. |
nTrackingSearchRadius |
15 |
Specifies the tracking radius when transferring angle marker coordinates to the next image in the image set. |
bCentroid |
false |
Specifies whether each vertex coordinate is updated to centroid coordinates before drawing on the image. |
bCentroidPositive |
false |
Specifies whether the centroid calculation assumes the object has positive (true) or negative (false) values relative to the background. |
bCentroidAfterMove |
false |
Specifies whether each vertex coordinate is updated to centroid coordinates before drawing on the image. |
bCentroidTrack |
false |
Specifies whether the centroid is computed for the vertex when transferring region markers from one image to the next. |
bUseDockingPane |
false |
Specifies whether to list region measurements (area, mean, etc.) in a docking pane (true) instead of a measurement window (false). |
Update Status: |
|
|
bSetColor |
false |
Enables changes to sColor. |
bSetRasterOp |
false |
Enables changes to nRasterOp. |
bSetLineThk |
false |
Enables changes to nLineThk. |
bSetFilled |
false |
Enabled canges to bFilled. |
bSetMatchingTol |
false |
Enables changes to nMatchingTol. |
bSetClosureTol |
false |
Enables changes to nClosureTol. |
bSetCentroidRadius |
false |
Enables changes to nCentroidRadius. |
bSetTrackingSearchRadius |
false |
Enables changes to nTrackingSearchRadius. |
bSetCentroid |
false |
Enables changes to bCentroid. |
bSetCentroidPositive |
false |
Enables changes to bCentroidPositive. |
bSetCentroidAfterMove |
false |
Enables changes to bCentroidAfterMove. |
bSetCentroidTrack |
false |
Enables changes to bCentroidTrack. |
bSetUseDockingPane |
false |
Enables changes to bUseDockingPane. |
Suppose an image window exists on the Mira screen and you have a collection of x,y points that define a polygon to be drawn on the image. The script below sets the drawing color and line thickness before drawing a region on the image.
|
-- attach an image window |
|
-- leave script if no image window |
|
|
|
-- get the top-most or only image |
|
-- leave script if no image |
|
|
|
-- create a CMeasureRegions object |
|
-- setup an RegionParams table |
|
-- use a comma after each "name=value" pair |
|
-- enable new marker color |
|
|
|
-- enable new line thickness |
|
|
|
|
|
-- set the new properties |
|
|
|
-- create a table to hold points |
|
-- x[1] |
|
-- y[1] |
|
-- x[2] |
|
-- y[2] |
-- add more vertex points |
|
|
-- Add a region marker to the image |
CMeasureRegions class, SetParams
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.