CImage:GetImageScaleXy


The GetImageScaleXy method returns the scale in distance units per pixel independently for the 2 lowest axes. Use this for a 2-dimensional image or for axes 1 and 2 of an n-dimensional image.

Syntax

nScaleX, nScaleY = CImage:GetImageScaleXy()

where

    nScaleX and nScaleY are the image scale, measured in distance uniits per pixel.

    On failure, this method returns the default values 1,1.

  

If the image has a WCS calibration, this returns WCS distance units per pixel. If there is no WCS calibration, measurements it returns 1,1. If the image has a different scale in each axis, use the GetImageScale method.

Example

Assume a displayed image has a WCS calibration giving 45.2 microns per pixel in the column axis and 42.4 microns per pixel in the row axis. The following script returns the image scales:

I = V:GetImage()

-- load the image from a display window

x, y = I:GetImageScaleXy()

-- return the scale as a number

Printf("Scale= %lg, %lg",x,y)

-- result: Scale= 45.2, 42.4.

Related Topics

GetImageScale

CImage class