getComplexMode
Top  Previous  Next

val = getComplexMode ( integer Image )

Use this function to retrieves the mode of the active component of a complex image. Each pixel of a complex image is a complex number, i.e. it is represented by two floating point values. If a complex image is in the Cartesian system, those values will correspond to the real (Re) and imaginary (Im) components of a pixel. . If a complex image is in the polar system, the pair of values for each pixel will correspond to the amplitude (Amp) and phase (Ph) component of the complex number. The active component of a complex image is the one that is displayed in the corresponding image frame and used by drawing functions.

Parameters
 
Image  
 
An integer between 0 and 116 specifying the frame number of the complex image. A value of 0 represents the DMA memory buffer of the video device. Values in the range of 100-116 correspond to hidden frames.  
 
Return value

An enumerated integer specifying the active component of the complex image. Can be one of the following values:  
 
CM_RE – the Real component of the image is active.  
CM_IM – the Imaginary component of the image is active.  
CM_AM – the Amplitude component of the image is active.  
CM_PH – the Phase component of the image is active.  
 
Error flags

ERR_OK  
 
The flag set if successful.  
 
ERR_FAILED  
 
The flag set if failed.  
 
Example

This set of statements creates a complex image as a result of the Fourier transform and retrieves the mode of its active component.  
 
grabIm (100)  
fourier (100,1, M_DIRECT, TRUE)  
mode=getComplexMode (1)  
if mode=CM_RE then print "Real"  
if mode=CM_IM then print "Imaginary"  
if mode=CM_AM then print "Amplitude"  
if mode=CM_PH then print "Phase"