CImage:GetImageScale


The GetImageScale method returns the image scale in physical ("world coordinate") distance units per pixel. If an axis is specified, then the value is returned for that axis, otherwise the average scale is returned.

Syntax

nScale = CImage:GetImageScale()

nScale = CImage:GetImageScale( nAxis )

where

    nAxis is the axis number, starting at 1. If omitted, and average scale is returned.

    nScale is the image scale, measured as distance units per pixel.

  

If the image has a WCS calibration, this returns WCS distance units per pixel in the specified direction. If there is no WCS calibration, measurements it returns 1.0. The related GetImageScaleXy is taylored to 2-dimensional images by returning two values: the image scale along axis 1 (columns) and axis 2 (rows).

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

GetImageScaleXy

CImage class