CImage:GetImageScale


The GetImageScale method returns the scale in distance units per pixel.

Syntax

nScale = CImage:GetImageScale()

bullet.gif    number is in distance units per pixel.

bullet.gif    On success, this method returns nScale as a number.

bullet.gif    On failure, this method returns nil.

Remarks

If the image has a WCS calibration, this returns WCS distance units per pixel. If there is no WCS calibration, measurements it returns 1.0. This method returns an average for both axes. If the image has a different scale in each axis, use the GetImageScaleXy method.

Example

Assume a displayed image has a WCS calibration giving 45.2 microns per pixel. The following script returns the image scale:

I = V:GetImage()

-- load the image from a display window

d = I:GetImageScale()

-- return the scale as a number

Printf("Scale= %lg", d )

-- result: Scale= 45.2.

Related Topics

CImage class, GetImageScaleXy


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