CImage:GetImageScale
The GetImageScale method returns the scale in distance units per pixel.
nScale = CImage:GetImageScale()
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 fragment returns the image scale:
|
-- load the image from a display window |
|
-- return the scale as a number |
|
-- result: Scale= 45.2. |