CImCombine:GetErrorMsg


The GetErrorMsg method returns the error message when combining fails. Failure occurs when any combining method, such as Mean, SigmaClip, ContraMean, etc., returns a nil value in place of the new image. If a nil value is returned, the script can call the present method to get information about what went wrong.

Syntax

sMsg = CImCombine:GetErrorMsg()

where

    sMsg is the error message. If no error occurred, the value is "Success".

Example

Suppose a CImageSet named S exists. The following script attempts to combine the image set using the Mean method, but the method fails because one of the images has a different dimension than the others:

C = CImCombine:new()

-- create a CImCombine object

R = NewRect(10,50,10,50)

-- central 10% of the image

C:SetRelRect( 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

if ( I == nil ) then

 

  Exit( C:GetErrorMsg() )

-- show the error message and abort

end

 

I:Display()

-- show the new image

Related Topics

CImCombine class