CImCombine Class Description


The CImCombine class provides methods for combining images in "intensity space" into a single image of the same size. Additional methods are provided for merging RGB images and for aligning images using their World Coordinate System calibrations. The processing methods take their images either from a CImageSet collection or a table of file names. The statistical methods use the same algorithms as the CStats class. See Combining Images using Criteria for an example showing how to use criteria to select and combine images.

Usage

Construction

Object = new_imcombine()

Object = CImCombine:new()

Object = CImCombine:new( CImCombine )

Destruction

Object:delete()

Creation - Non-class Functions

This function is normally used to create a new CImCombine object as an alternative to the class-based new method.

new_imcombine

Creates a new instance of the CImCombine class.

Construction and Destruction - Class Methods

new

Creates a new instance of the CImCombine class. A default constructor and a copy constructor are available.

delete

Deletes the instance of the CImCombine object.

Copy

Copies the CImCombine to a new CImCombine

SaveState

Saves the current class member data so they can be restored later.

RestoreState

Restores all class members to their last saved state.

Operations

The methods in the CImCombine class combine the images of a CImageSet or table containing the file names of images. The algorithm works like this: For each pixel in turn. the resulting pixel value is computed from the same pixel in all images being combined. This procedure is repeated for each pixel location. Using file names, rather than a CimageSet, gets around the limitation of having all images in memory at the same time. This may be necessary to work around memory limits when combining a large number of images or many images that are very large.

These combining methods fall into 2 general groups:

  1. Methods that merge images into a single, higher quality image according to the mean, median, or other statistical averaging process.

  2. Methods that evaluate a pixel property or a statistic among a set of images, such as the standard deviation or kurtosis value.

Methods in the first group are further split into two subgroups: those that compute means and weighted means and those that perform some type of bad data rejection, or "clipping".

Weighted Means and Related Procedures

These methods combine all pixels of all images using some form of weighting scheme.

ContraMean

Merges images using contra-harmonic mean weighting at each location. The exponent is a required parameter.

GeometricMean

Merges images by the geometric mean at each pixel location.

Mean

Merges images by the mean value using equal weight at each pixel location.

Median

Merges images using the median value at each pixel location.

Rank

Merges images by choosing the pixel at a given rank at each location. The rank percentile is a parameter.

Sum

Merges images using the sum of values at each pixel location.

YpMean

Merges images using power law weighting at each location. The exponent, Yp, is a required parameter.

Rejection Methods

These methods discard the pixels from some of the images if they do not meet some criterion for inclusion. These methods differ on the type of criterion they use. All use parameters to control the rejection criterion, although the parameters may be "hard-wired", such as the min/max clipping which always rejects both the highest and the lowest pixel values from the mean. Rejection methods typically require normalization of the pixel values for the rejection process to work correctly. See the Normalization methods below.

AlphaClip

Merges images after clipping a selected number high and low outlying pixel values at each pixel location.

KwdWeightedMean

Merge images using a weighted mean based on the value of a header keyword.

MaskedMean

Merges images by the mean value after excluding 0-valued pixels at each location.

MaxClip

Merges images after clipping the maximum pixel value at each location.

MmClip

Merges images after excluding the minimum and maximum values at each location.

MtmSigmaClip

Merges images using a modified trimmed mean by clipping high and low outlying values based on the standard deviation at each location.

RankClip

Merges images by the mean value after excluding values outside upper and lower rank percentiles at each location.

SigmaClip

Merges images using the mean value after clipping high and low outlying values based on the standard deviation at each location.

WeightedMean

Merge images using a weighted mean based on a 1-dimensional array of weight values.

Alignment

AlignWcs

Aligns a CImageSet collection of images to one of the set members using their world coordinate system calibrations.

AlignWcs2

Provides an alternative to AlignWcs that gives slightly less subpixel level sharpness but slightly faster execution. Aligns a CImageSet collection of images to one of the set members using their world coordinate system calibrations.

AlignWcs3

Provides an alternative to AlignWcs and AlignWcs2 that gives only pixel-level sharpness but faster execution. Aligns a CImageSet collection of images to one of the set members using their world coordinate system calibrations.

Other Combining Methods

Max

Merges images using the maximum value at each pixel location.

Min

Merges images using the minimum value at each pixel location.

MmClipRange

Creates an image showing the range of pixel values excluding the highest and lowest values at each location.

Range

Creates an image consisting of the range of values within the image set.

RgbMerge

Merge color channel images into an RGB image.

Sdev

Creates an image consisting of the standard deviation among pixels at each location.

Normalization

These methods control the image normalization procedure. Normalization should be performed by any rejection method used to combine the images. The normalization properties are set using methods in the table below, and will be implemented during execution of the combining method.

SetNormMethod

Sets the arithmetic method used to correct images to common statistical level. The options are scale, offset, and none.

SetNormStat

Sets the normalization statistic used for adjusting images to similar signal levels before combining.

SetRect

Sets the rectangle used for computing the normalization statistic.

SetRelRect

Sets a fractional rectangle for computing the normalization statistic.

Miscellaneous Methods

GetErrorMsg

Returns the error message from the sErrMsg class property when nStatusCode is returned as 0 or negative.

SetVerbose

Sets verbose method on or off.

SetRefImage

Sets the index of the reference image in the image set.

SetTitle

Sets the title of the message window used in verbose mode.

SetAdjustExptime

Sets the state of the exposure time adjustment flag.

Related Topics

Script Classes, CImageSet class, CImage class, CStats Class


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