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 fragment 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. |