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.
string = CImCombine:GetErrorMsg() |
the error is returned as string. If no error occurred, the value is "Success".
Suppose a CImageSet named S exists. The following script fragment 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 = CRect:new(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 |
C:delete() |
-- when done with S, remove it from memory |