CImCombine:SetRect
The SetRect method defines an absolute coordinate rectangle for sampling the image to compute the image normalization statistic.
CImCombine:SetRect( CRect ) |
CRect is the rectangle object containing pixel coordinates.
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 ).
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:
|
-- create a CImCombine object |
|
-- 100 x 100 pixel region |
|
-- specify CImage and CRect to measure |
|
-- use the median as the normalization statistic |
|
-- scale to normalize the image set |
|
-- combine the image set and return a new image |
|
-- show the new image |
|
-- when done with S, remove it from memory |
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics,
Inc. All Rights Reserved.