RadialGradientLabel2d
Performs a two-dimensional gradient projection with a directional vector defined by a set of object centers of a label image.
Access to parameter description
For an introduction:
Notices:
Access to parameter description
For an introduction:
- section Edge Detection
- section Introduction to Gradient
- section Gradient Projections
Notices:
- A common way to get input images Gx and Gy is to apply the Canny-Deriche operator in the X and Y directions, using GradientOperator2d with a spread of 60.
- The projected resulting gradient image shown above is the Normal Gradient. Simultaneously, the tangential gradient could be computed with the ProjectionMode option GRADIENT_NORMAL_TANGENTIAL.
Function Syntax
This function returns a RadialGradientLabel2dOutput structure containing outputNormalImage and outputTangentImage.
// Output structure of the radialGradientLabel2d function. struct RadialGradientLabel2dOutput { /// The normal gradient output image. std::shared_ptr< iolink::ImageView > outputNormalImage; /// The tangent gradient output image. std::shared_ptr< iolink::ImageView > outputTangentImage; }; // Function prototype
RadialGradientLabel2dOutput radialGradientLabel2d( std::shared_ptr< iolink::ImageView > inputImageX, std::shared_ptr< iolink::ImageView > inputImageY, std::shared_ptr< iolink::ImageView > inputMarkerImage, RadialGradientLabel2d::ProjectionMode projectionMode, std::shared_ptr< iolink::ImageView > outputNormalImage = NULL, std::shared_ptr< iolink::ImageView > outputTangentImage = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
![]() |
inputImageX |
The X-gradient input image. | Image | Grayscale or Multispectral | nullptr | ||||
![]() |
inputImageY |
The Y-gradient input image. | Image | Grayscale or Multispectral | nullptr | ||||
![]() |
inputMarkerImage |
The marker input image of the label objects to consider as centers. | Image | Label | nullptr | ||||
![]() |
projectionMode |
The output images to be computed.
|
Enumeration | GRADIENT_NORMAL | |||||
![]() |
outputNormalImage |
The normal gradient output image. | Image | nullptr | |||||
![]() |
outputTangentImage |
The tangent gradient output image. | Image | nullptr |
Object Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto polystyrene_sep_label = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep_label.vip" ); RadialGradientLabel2d radialGradientLabel2dAlgo; radialGradientLabel2dAlgo.setInputImageX( polystyrene ); radialGradientLabel2dAlgo.setInputImageY( polystyrene ); radialGradientLabel2dAlgo.setInputMarkerImage( polystyrene_sep_label ); radialGradientLabel2dAlgo.setProjectionMode( RadialGradientLabel2d::ProjectionMode::GRADIENT_NORMAL ); radialGradientLabel2dAlgo.execute(); std::cout << "outputNormalImage:" << radialGradientLabel2dAlgo.outputNormalImage()->toString(); std::cout << "outputTangentImage:" << radialGradientLabel2dAlgo.outputTangentImage()->toString();
Function Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto polystyrene_sep_label = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep_label.vip" ); auto result = radialGradientLabel2d( polystyrene, polystyrene, polystyrene_sep_label, RadialGradientLabel2d::ProjectionMode::GRADIENT_NORMAL ); std::cout << "outputNormalImage:" << result.outputNormalImage->toString(); std::cout << "outputTangentImage:" << result.outputTangentImage->toString();