CImCombine:SetNormStat CImCombine:SetRelRect

CImCombine:SetRect


The SetRect method defines an absolute coordinate rectangle for sampling the image to compute the image normalization statistic.

Syntax

CImCombine:SetRect( CRect )

bullet.gif    CRect is the rectangle object containing pixel coordinates.

Remarks

The normalization region may be specified in absolute pixel coordinates (i.e., in terms of column number and row number) or in relative coordinates as a fractional region dimension placed at a fractional position on the image. The advantage of the absolute rectangle method (the current one) is that the dimensions can be expressed exactly. The disadvantage is that the rectangle may not lie in a favorable location on an image of different dimensions. Alternatively, the SetRelRect method specifies a rectangle in terms of fractional image position, which is independent of image dimension.

As normal in Mira, the rectangle is specified in the order xmin, xmax, ymin, ymax. For example, to set the rectangle over columns 100 to 200 and rows 400 to 500, set CRect( 100, 200, 400, 500 ).

Example

Suppose a CImageSet named S exists. The following script uses a CRect object to define the normalization region and then combines the images using the Mean method:

C = new_imcombine()

-- create a CImCombine object

R = new_rect(200,300,200,400)

-- 100 x 100 pixel region

C:SetRect( R )

-- specify CImage and CRect to measure

C:SetNormStat("median")

-- use the median as the normalization statistic

C:SetNormMethod("scale")

-- scale to normalize the image set

I = C:Mean( S )

-- combine the image set and return a new image

I:Display()

-- show the new image

C:delete()

-- when done with S, remove it from memory

Related Topics

CImCombine class

CImageSet class

CImage class

CRect class

 


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.