PointParams Table


The PointParams table contains properties used by the CMeasurePoints class. This table is used to change properties using the class SetParams method.

The reference table below lists the point 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 PointParams table, you must the the status flag to true. Create a PointParams table containing only the properties you wish to change. Then call the class SetParams method with the PointParams table as its parameter.

Table Member

Default

Definition

Property:

 

 

sColor

"255,0,0"

The color of the point. See the nRasterOp property.

nRasterOp

13

Controls the way the marker color and image color are combined for drawing. The default draw markers with a solid line of color sColor.

nMarkerSize

33

Sets the length and width of the crosshair marker, in pixels.

nLineThk

1

Sets the thickness of the marker line, in pixels, drawn on the image.

nMatchingTol

3

Sets the tolerance, in pixels, for mouse click "hits" to the point.

nCentroidRadius

15

The centroid radius when the vertex is adjusted to the centroid coordinates.

nTrackingSearchRadius

15

Specifies the tracking radius when transferring point marker coordinates to the next image in the image set.

bCentroid

false

Specifies whether the 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 the 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 point markers from one image to the next.

bUseDockingPane

false

Specifies whether to list point measurements 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.

bSetMarkerSize

false

Enables changes to nMarkerSize.

bSetLineThk

false

Enables changes to nLineThk.

bSetMatchingTol

false

Enables changes to nMatchingTol.

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.

Example

Suppose an image window exists on the Mira screen and you have a collection of approximate coordinates of objects you wish to mark on the image at improves coordinates based on the centroid computation. The script below enables centroid computation and sets the marker size, drawing color, and line thickness for the point markers.

V = attachlist_imageview()

-- attach an image window

Assert( V, "No image window")

-- leave script if no image window

 

 

I = V:GetImage()

-- get the top-most or only image

Assert( I, "No image selected")

-- leave script if no image

 

 

P = new_measurepoints()

-- create a CMeasurePoints object

Params =

-- setup an PointParams table

{

-- use a comma after each "name=value" pair

  bSetCentroid = true,

-- enable centroid for points

  bCentroid = true,

 

  bSetColor = true,

-- enable new marker color

  sColor = "0,255,0",

 

  bSetMarkerSize = true,

-- enable new marker size

  nMarkerSize = 65,

 

  bSetLineThk = true,

-- enable new line thickness

  nLineThk = 2,

 

}

 

P:SetParams(Params)

-- set the new properties

 

 

x = 300; y = 7500

-- coordinates of the point to mark

P:Add(I, x, y)

-- Add an point marker to the image

Related Topics

CMeasurePoints class, SetParams


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.