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 outputAmplitudeImage.
// 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 );

Class Syntax

Parameters

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();

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();