setComplexMode
Top  Previous  Next

setComplexMode ( integer Image, integer Mode )

Use this function to change 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. When you make a complex component active, it will be 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 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.  
 
Mode  
 
An enumerated integer specifying the component of the complex image that will become active. Must be one of the following values:  
CM_RE – converts the image into the Cartesian coordinate system and makes the Real component active.  
CM_IM – converts the image into the Cartesian coordinate system and makes the Imaginary component active.  
CM_AM – converts the image into the polar coordinate system and makes the Amplitude component active.  
CM_PH – converts the image into the polar coordinate system and makes the Phase component 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 sets the active component to Phase.  
 
grabIm (100)  
fourier (100,1, M_DIRECT, TRUE)  
setComplexMode (1, CM_PH )