ImageDev

PolarToCartesian2d

Transforms a pair of module and phase two-dimensional images into a pair of real and imaginary part images.

Access to parameter description

For an introduction: see section Frequency Domain.

This algorithm computes the polar-to-cartesian transformation or module/phase to the real/imaginary image transformation.

If $I_1$ is the module image and $I_2$ the phase image, then: See also

Function Syntax

This function returns a PolarToCartesian2dOutput structure containing outputRealImage and outputImaginaryImage.
// Output structure of the polarToCartesian2d function.
struct PolarToCartesian2dOutput
{
    /// The output real part image. Its dimensions and type are forced to the same values as the input.
    std::shared_ptr< iolink::ImageView > outputRealImage;
    /// The output imaginary part image. Its dimensions and type are forced to the same values as the input.
    std::shared_ptr< iolink::ImageView > outputImaginaryImage;
};

// Function prototype
PolarToCartesian2dOutput polarToCartesian2d( std::shared_ptr< iolink::ImageView > inputModulusImage, std::shared_ptr< iolink::ImageView > inputPhaseImage, std::shared_ptr< iolink::ImageView > outputRealImage = NULL, std::shared_ptr< iolink::ImageView > outputImaginaryImage = NULL );
This function returns a tuple containing output_real_image and output_imaginary_image.
// Function prototype.
polar_to_cartesian_2d( input_modulus_image,
                       input_phase_image,
                       output_real_image = None,
                       output_imaginary_image = None )
This function returns a PolarToCartesian2dOutput structure containing outputRealImage and outputImaginaryImage.
/// Output structure of the PolarToCartesian2d function.
public struct PolarToCartesian2dOutput
{
    /// 
    /// The output real part image. Its dimensions and type are forced to the same values as the input.
    /// 
    public IOLink.ImageView outputRealImage;
    /// 
    /// The output imaginary part image. Its dimensions and type are forced to the same values as the input.
    /// 
    public IOLink.ImageView outputImaginaryImage;
};

// Function prototype.
public static PolarToCartesian2dOutput
PolarToCartesian2d( IOLink.ImageView inputModulusImage,
                    IOLink.ImageView inputPhaseImage,
                    IOLink.ImageView outputRealImage = null,
                    IOLink.ImageView outputImaginaryImage = null );

Class Syntax

Parameters

Class Name PolarToCartesian2d

Parameter Name Description Type Supported Values Default Value
input
inputModulusImage
The modulus input image. It must be a floating point image. Image Grayscale or Multispectral nullptr
input
inputPhaseImage
The phase input image. This image must have same dimensions and data type as the modulus input image. Image Grayscale or Multispectral nullptr
output
outputRealImage
The output real part image. Its dimensions and type are forced to the same values as the input. Image nullptr
output
outputImaginaryImage
The output imaginary part image. Its dimensions and type are forced to the same values as the input. Image nullptr

Object Examples

auto polystyrene_float = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_float.vip" );

PolarToCartesian2d polarToCartesian2dAlgo;
polarToCartesian2dAlgo.setInputModulusImage( polystyrene_float );
polarToCartesian2dAlgo.setInputPhaseImage( polystyrene_float );
polarToCartesian2dAlgo.execute();

std::cout << "outputRealImage:" << polarToCartesian2dAlgo.outputRealImage()->toString();
std::cout << "outputImaginaryImage:" << polarToCartesian2dAlgo.outputImaginaryImage()->toString();
polystyrene_float = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_float.vip"))

polar_to_cartesian_2d_algo = imagedev.PolarToCartesian2d()
polar_to_cartesian_2d_algo.input_modulus_image = polystyrene_float
polar_to_cartesian_2d_algo.input_phase_image = polystyrene_float
polar_to_cartesian_2d_algo.execute()

print( "output_real_image:", str( polar_to_cartesian_2d_algo.output_real_image ) )
print( "output_imaginary_image:", str( polar_to_cartesian_2d_algo.output_imaginary_image ) )
ImageView polystyrene_float = Data.ReadVipImage( @"Data/images/polystyrene_float.vip" );

PolarToCartesian2d polarToCartesian2dAlgo = new PolarToCartesian2d
{
    inputModulusImage = polystyrene_float,
    inputPhaseImage = polystyrene_float
};
polarToCartesian2dAlgo.Execute();

Console.WriteLine( "outputRealImage:" + polarToCartesian2dAlgo.outputRealImage.ToString() );
Console.WriteLine( "outputImaginaryImage:" + polarToCartesian2dAlgo.outputImaginaryImage.ToString() );

Function Examples

auto polystyrene_float = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_float.vip" );

auto result = polarToCartesian2d( polystyrene_float, polystyrene_float );

std::cout << "outputRealImage:" << result.outputRealImage->toString();
std::cout << "outputImaginaryImage:" << result.outputImaginaryImage->toString();
polystyrene_float = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_float.vip"))

result_output_real_image, result_output_imaginary_image = imagedev.polar_to_cartesian_2d( polystyrene_float, polystyrene_float )

print( "output_real_image:", str( result_output_real_image ) )
print( "output_imaginary_image:", str( result_output_imaginary_image ) )
ImageView polystyrene_float = Data.ReadVipImage( @"Data/images/polystyrene_float.vip" );

Processing.PolarToCartesian2dOutput result = Processing.PolarToCartesian2d( polystyrene_float, polystyrene_float );

Console.WriteLine( "outputRealImage:" + result.outputRealImage.ToString() );
Console.WriteLine( "outputImaginaryImage:" + result.outputImaginaryImage.ToString() );