ImageDev

EstimateShortestPath3d

Creates a binary image representing the shortest path following an axis of propagation through a three-dimensional image.

Access to parameter description

This algorithm provides a binary image representing the shortest path traveled by the flood fill propagation from a seed in porous phase.

The image is obtained by summing the 2 distance images (top to bottom and bottom to top) and then thresholding the intensity level equal to the minimum distance traveled from the seed.

Propagation is performed from the seeds, along the user defined axis, through voxels of intensity X verifying the following four conditions: In the binary case, the maskAndSeedValues and maximumThreshold are ignored. The propagation does not reject any specific value, propagates through 0 intensity values and stops on 1 intensity values. It amounts to considering maskAndSeedValues at [2, 0] and maximumThreshold at 0.

See also

Function Syntax

This function returns outputBinaryImage.
// Function prototype
std::shared_ptr< iolink::ImageView > estimateShortestPath3d( std::shared_ptr< iolink::ImageView > inputImage, iolink::Vector2i32 maskAndSeedValues, int32_t maximumThreshold, EstimateShortestPath3d::Axis axis, std::shared_ptr< iolink::ImageView > outputBinaryImage = nullptr );
This function returns outputBinaryImage.
// Function prototype.
estimate_shortest_path_3d(input_image: idt.ImageType,
                          mask_and_seed_values: Iterable[int] = [255, -1024],
                          maximum_threshold: int = 128,
                          axis: EstimateShortestPath3d.Axis = EstimateShortestPath3d.Axis.Z_AXIS,
                          output_binary_image: idt.ImageType = None) -> idt.ImageType
This function returns outputBinaryImage.
// Function prototype.
public static IOLink.ImageView
EstimateShortestPath3d( IOLink.ImageView inputImage,
                        int[] maskAndSeedValues = null,
                        Int32 maximumThreshold = 128,
                        EstimateShortestPath3d.Axis axis = ImageDev.EstimateShortestPath3d.Axis.Z_AXIS,
                        IOLink.ImageView outputBinaryImage = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input grayscale, binary, or color image. In the case of a binary image, the background represents the phase where the propagation has to be performed. Image Binary, Label or Grayscale nullptr
input
maskAndSeedValues
The first value is a mask value. Voxels with this intensity value are not infiltrated by the propagation. The second value is the seed value. Voxels with an intensity value lower than this seed value are not infiltrated by the propagation. A value lower than the second value of maskAndSeedValues or greater or equal to maximumThreshold is ignored. This parameter is ignored in binary case, and then is forced to [2, 0]. Vector2i32 Any value {255, -1024}
input
maximumThreshold
The maximum propagation intensity value. Voxels having an intensity value greater or equal to this value are rejected by the propagation. This parameter is ignored in binary case, and is forced to 1. Int32 Any value 128
input
axis
The axis along which the propagation is performed.
X_AXIS The propagation is performed along the X axis.
Y_AXIS The propagation is performed along the Y axis.
Z_AXIS The propagation is performed along the Z axis.
Enumeration Z_AXIS
output
outputBinaryImage
The binary output image represents the shortest propagation path seeds. Its dimensions are forced to the same values as the input. Image nullptr
Parameter Name Description Type Supported Values Default Value
input
input_image
The input grayscale, binary, or color image. In the case of a binary image, the background represents the phase where the propagation has to be performed. image Binary, Label or Grayscale None
input
mask_and_seed_values
The first value is a mask value. Voxels with this intensity value are not infiltrated by the propagation. The second value is the seed value. Voxels with an intensity value lower than this seed value are not infiltrated by the propagation. A value lower than the second value of maskAndSeedValues or greater or equal to maximumThreshold is ignored. This parameter is ignored in binary case, and then is forced to [2, 0]. vector2i32 Any value [255, -1024]
input
maximum_threshold
The maximum propagation intensity value. Voxels having an intensity value greater or equal to this value are rejected by the propagation. This parameter is ignored in binary case, and is forced to 1. int32 Any value 128
input
axis
The axis along which the propagation is performed.
X_AXIS The propagation is performed along the X axis.
Y_AXIS The propagation is performed along the Y axis.
Z_AXIS The propagation is performed along the Z axis.
enumeration Z_AXIS
output
output_binary_image
The binary output image represents the shortest propagation path seeds. Its dimensions are forced to the same values as the input. image None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The input grayscale, binary, or color image. In the case of a binary image, the background represents the phase where the propagation has to be performed. Image Binary, Label or Grayscale null
input
maskAndSeedValues
The first value is a mask value. Voxels with this intensity value are not infiltrated by the propagation. The second value is the seed value. Voxels with an intensity value lower than this seed value are not infiltrated by the propagation. A value lower than the second value of maskAndSeedValues or greater or equal to maximumThreshold is ignored. This parameter is ignored in binary case, and then is forced to [2, 0]. Vector2i32 Any value {255, -1024}
input
maximumThreshold
The maximum propagation intensity value. Voxels having an intensity value greater or equal to this value are rejected by the propagation. This parameter is ignored in binary case, and is forced to 1. Int32 Any value 128
input
axis
The axis along which the propagation is performed.
X_AXIS The propagation is performed along the X axis.
Y_AXIS The propagation is performed along the Y axis.
Z_AXIS The propagation is performed along the Z axis.
Enumeration Z_AXIS
output
outputBinaryImage
The binary output image represents the shortest propagation path seeds. Its dimensions are forced to the same values as the input. Image null

Object Examples

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

EstimateShortestPath3d estimateShortestPath3dAlgo;
estimateShortestPath3dAlgo.setInputImage( foam );
estimateShortestPath3dAlgo.setMaskAndSeedValues( {255, -1024} );
estimateShortestPath3dAlgo.setMaximumThreshold( 128 );
estimateShortestPath3dAlgo.setAxis( EstimateShortestPath3d::Axis::X_AXIS );
estimateShortestPath3dAlgo.execute();

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

estimate_shortest_path_3d_algo = imagedev.EstimateShortestPath3d()
estimate_shortest_path_3d_algo.input_image = foam
estimate_shortest_path_3d_algo.mask_and_seed_values = [255, -1024]
estimate_shortest_path_3d_algo.maximum_threshold = 128
estimate_shortest_path_3d_algo.axis = imagedev.EstimateShortestPath3d.X_AXIS
estimate_shortest_path_3d_algo.execute()

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

EstimateShortestPath3d estimateShortestPath3dAlgo = new EstimateShortestPath3d
{
    inputImage = foam,
    maskAndSeedValues = new int[]{255, -1024},
    maximumThreshold = 128,
    axis = EstimateShortestPath3d.Axis.X_AXIS
};
estimateShortestPath3dAlgo.Execute();

Console.WriteLine( "outputBinaryImage:" + estimateShortestPath3dAlgo.outputBinaryImage.ToString() );

Function Examples

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

auto result = estimateShortestPath3d( foam, {255, -1024}, 128, EstimateShortestPath3d::Axis::X_AXIS );

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

result = imagedev.estimate_shortest_path_3d(foam, [255, -1024], 128, imagedev.EstimateShortestPath3d.X_AXIS)

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

IOLink.ImageView result = Processing.EstimateShortestPath3d( foam, new int[]{255, -1024}, 128, EstimateShortestPath3d.Axis.X_AXIS );

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