ImageDev

VectorToMagnitude3d

Computes the amplitude of a 3D vector such as a gradient from its X, Y, and Z components.

Access to parameter description

For an introduction to gradient operations: Gradient Section.

VectorToMagnitude3d extracts the Euclidean norm or maximum component of a 3D vector from its X, Y, and Z components.
It is typically used to compute the magnitude of a 3D image gradient.
The results depend on the selected output mode.

See also

Function Syntax

This function returns the outputAmplitudeImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
vectorToMagnitude3d( std::shared_ptr< iolink::ImageView > inputImageX,
                     std::shared_ptr< iolink::ImageView > inputImageY,
                     std::shared_ptr< iolink::ImageView > inputImageZ,
                     VectorToMagnitude3d::OutputType outputType,
                     std::shared_ptr< iolink::ImageView > outputAmplitudeImage = NULL );
This function returns the outputAmplitudeImage output parameter.
// Function prototype.
vector_to_magnitude_3d( input_image_x,
                        input_image_y,
                        input_image_z,
                        output_type = VectorToMagnitude3d.OutputType.AMPLITUDE_MAXIMUM,
                        output_amplitude_image = None )
This function returns the outputAmplitudeImage output parameter.
// Function prototype.
public static IOLink.ImageView
VectorToMagnitude3d( IOLink.ImageView inputImageX,
                     IOLink.ImageView inputImageY,
                     IOLink.ImageView inputImageZ,
                     VectorToMagnitude3d.OutputType outputType = ImageDev.VectorToMagnitude3d.OutputType.AMPLITUDE_MAXIMUM,
                     IOLink.ImageView outputAmplitudeImage = null );

Class Syntax

Parameters

Class Name VectorToMagnitude3d

Parameter Name Description Type Supported Values Default Value
input
inputImageX
The X vector component input image. Image Grayscale or Multispectral nullptr
input
inputImageY
The Y vector component input image. Image Grayscale or Multispectral nullptr
input
inputImageZ
The Z vector component input image. Image Grayscale or Multispectral nullptr
input
outputType
The output mode.
AMPLITUDE_MAXIMUM This option computes the amplitude as the maximum between X, Y, and Z components.
AMPLITUDE_EUCLIDEAN This option computes the Euclidean norm of the vector.
Enumeration AMPLITUDE_MAXIMUM
output
outputAmplitudeImage
The gradient amplitude output image. Image nullptr

Object Examples

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

VectorToMagnitude3d vectorToMagnitude3dAlgo;
vectorToMagnitude3dAlgo.setInputImageX( foam );
vectorToMagnitude3dAlgo.setInputImageY( foam );
vectorToMagnitude3dAlgo.setInputImageZ( foam );
vectorToMagnitude3dAlgo.setOutputType( VectorToMagnitude3d::OutputType::AMPLITUDE_MAXIMUM );
vectorToMagnitude3dAlgo.execute();

std::cout << "outputAmplitudeImage:" << vectorToMagnitude3dAlgo.outputAmplitudeImage()->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

vector_to_magnitude_3d_algo = imagedev.VectorToMagnitude3d()
vector_to_magnitude_3d_algo.input_image_x = foam
vector_to_magnitude_3d_algo.input_image_y = foam
vector_to_magnitude_3d_algo.input_image_z = foam
vector_to_magnitude_3d_algo.output_type = imagedev.VectorToMagnitude3d.AMPLITUDE_MAXIMUM
vector_to_magnitude_3d_algo.execute()

print( "output_amplitude_image:", str( vector_to_magnitude_3d_algo.output_amplitude_image ) )
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

VectorToMagnitude3d vectorToMagnitude3dAlgo = new VectorToMagnitude3d
{
    inputImageX = foam,
    inputImageY = foam,
    inputImageZ = foam,
    outputType = VectorToMagnitude3d.OutputType.AMPLITUDE_MAXIMUM
};
vectorToMagnitude3dAlgo.Execute();

Console.WriteLine( "outputAmplitudeImage:" + vectorToMagnitude3dAlgo.outputAmplitudeImage.ToString() );

Function Examples

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

auto result = vectorToMagnitude3d( foam, foam, foam, VectorToMagnitude3d::OutputType::AMPLITUDE_MAXIMUM );

std::cout << "outputAmplitudeImage:" << result->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

result = imagedev.vector_to_magnitude_3d( foam, foam, foam, imagedev.VectorToMagnitude3d.AMPLITUDE_MAXIMUM )

print( "output_amplitude_image:", str( result ) )
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

IOLink.ImageView result = Processing.VectorToMagnitude3d( foam, foam, foam, VectorToMagnitude3d.OutputType.AMPLITUDE_MAXIMUM );

Console.WriteLine( "outputAmplitudeImage:" + result.ToString() );