CImage:GetImageScale
The GetImageScale method returns the scale in distance units per pixel.
nScale = CImage:GetImageScale()
number is in distance units per pixel.
On success, this method returns nScale as a number.
On failure, this method returns nil.
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.
Assume a displayed image has a WCS calibration giving 45.2 microns per pixel. The following script returns the image scale:
|
-- load the image from a display window |
|
-- return the scale as a number |
|
-- result: Scale= 45.2. |
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.