ImageDev

AxisPropagationBinaryWithSeeds3d

Simulates the propagation through a phase of a three-dimensional image and computes a binary image representing the area where the propagation is performed.

Access to parameter description

For an introduction: This algorithm simulates the propagation in a user-defined phase of a volume, along user-defined axis and direction. Generally, the analyzed phase represents the porosity inside a material and the purpose of this algorithm is to study if this void space is connected through the volume.

A binary output image represents the area where the propagation occurs from the seed to another slice. A void output image means that there is no connected porosity. The last slice is systematically set to 0.

A measurement output object contains information about the propagation indicating whether the volume is pierced and distances traveled through the volume.

The maskAndSeedValues and maximumThreshold parameters identify areas of the image in which propagation can be done; therefore, it allows identifying non-porous areas.

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 a AxisPropagationBinaryWithSeeds3dOutput structure containing outputBinaryImage and outputMeasurement.
// Output structure of the axisPropagationBinaryWithSeeds3d function.
struct AxisPropagationBinaryWithSeeds3dOutput
{
    /// The binary output image representing the propagation within the selected phase. A void image means that there is no connected area through the selected axis and direction. Its dimensions are forced to the same values as the input.
    std::shared_ptr< iolink::ImageView > outputBinaryImage;
    /// The output measurement result.
    AxisPropagationBinary3dMsr::Ptr outputMeasurement;
};

// Function prototype
AxisPropagationBinaryWithSeeds3dOutput axisPropagationBinaryWithSeeds3d( std::shared_ptr< iolink::ImageView > inputImage, iolink::Vector2i32 maskAndSeedValues, int32_t maximumThreshold, AxisPropagationBinaryWithSeeds3d::Axis axis, AxisPropagationBinaryWithSeeds3d::PropagationDirection propagationDirection, std::shared_ptr< iolink::ImageView > outputBinaryImage = nullptr, AxisPropagationBinary3dMsr::Ptr outputMeasurement = nullptr );
This function returns a tuple containing output_binary_image and output_measurement.
// Function prototype.
axis_propagation_binary_with_seeds_3d(input_image: idt.ImageType,
                                      mask_and_seed_values: Iterable[int] = [255, -1024],
                                      maximum_threshold: int = 128,
                                      axis: AxisPropagationBinaryWithSeeds3d.Axis = AxisPropagationBinaryWithSeeds3d.Axis.Z_AXIS,
                                      propagation_direction: AxisPropagationBinaryWithSeeds3d.PropagationDirection = AxisPropagationBinaryWithSeeds3d.PropagationDirection.MIN_TO_MAX,
                                      output_binary_image: idt.ImageType = None,
                                      output_measurement: Union[Any, None] = None) -> Tuple[idt.ImageType, AxisPropagationBinary3dMsr]
This function returns a AxisPropagationBinaryWithSeeds3dOutput structure containing outputBinaryImage and outputMeasurement.
/// Output structure of the AxisPropagationBinaryWithSeeds3d function.
public struct AxisPropagationBinaryWithSeeds3dOutput
{
    /// 
    /// The binary output image representing the propagation within the selected phase. A void image means that there is no connected area through the selected axis and direction. Its dimensions are forced to the same values as the input.
    /// 
    public IOLink.ImageView outputBinaryImage;
    /// The output measurement result.
    public AxisPropagationBinary3dMsr outputMeasurement;
};

// Function prototype.
public static AxisPropagationBinaryWithSeeds3dOutput
AxisPropagationBinaryWithSeeds3d( IOLink.ImageView inputImage,
                                  int[] maskAndSeedValues = null,
                                  Int32 maximumThreshold = 128,
                                  AxisPropagationBinaryWithSeeds3d.Axis axis = ImageDev.AxisPropagationBinaryWithSeeds3d.Axis.Z_AXIS,
                                  AxisPropagationBinaryWithSeeds3d.PropagationDirection propagationDirection = ImageDev.AxisPropagationBinaryWithSeeds3d.PropagationDirection.MIN_TO_MAX,
                                  IOLink.ImageView outputBinaryImage = null,
                                  AxisPropagationBinary3dMsr outputMeasurement = 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 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
input
propagationDirection
The direction in which the propagation is performed.
MIN_TO_MAX The propagation is performed from the first to the last slice index.
MAX_TO_MIN The propagation is performed from the last to the first slice index.
Enumeration MIN_TO_MAX
output
outputBinaryImage
The binary output image representing the propagation within the selected phase. A void image means that there is no connected area through the selected axis and direction. Its dimensions are forced to the same values as the input. Image nullptr
output
outputMeasurement
The output measurement result. AxisPropagationBinary3dMsr 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 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
input
propagation_direction
The direction in which the propagation is performed.
MIN_TO_MAX The propagation is performed from the first to the last slice index.
MAX_TO_MIN The propagation is performed from the last to the first slice index.
enumeration MIN_TO_MAX
output
output_binary_image
The binary output image representing the propagation within the selected phase. A void image means that there is no connected area through the selected axis and direction. Its dimensions are forced to the same values as the input. image None
output
output_measurement
The output measurement result. AxisPropagationBinary3dMsr 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 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
input
propagationDirection
The direction in which the propagation is performed.
MIN_TO_MAX The propagation is performed from the first to the last slice index.
MAX_TO_MIN The propagation is performed from the last to the first slice index.
Enumeration MIN_TO_MAX
output
outputBinaryImage
The binary output image representing the propagation within the selected phase. A void image means that there is no connected area through the selected axis and direction. Its dimensions are forced to the same values as the input. Image null
output
outputMeasurement
The output measurement result. AxisPropagationBinary3dMsr null

Object Examples

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

AxisPropagationBinaryWithSeeds3d axisPropagationBinaryWithSeeds3dAlgo;
axisPropagationBinaryWithSeeds3dAlgo.setInputImage( foam_sep );
axisPropagationBinaryWithSeeds3dAlgo.setMaskAndSeedValues( {255, -1024} );
axisPropagationBinaryWithSeeds3dAlgo.setMaximumThreshold( 128 );
axisPropagationBinaryWithSeeds3dAlgo.setAxis( AxisPropagationBinaryWithSeeds3d::Axis::X_AXIS );
axisPropagationBinaryWithSeeds3dAlgo.setPropagationDirection( AxisPropagationBinaryWithSeeds3d::PropagationDirection::MIN_TO_MAX );
axisPropagationBinaryWithSeeds3dAlgo.execute();

std::cout << "outputBinaryImage:" << axisPropagationBinaryWithSeeds3dAlgo.outputBinaryImage()->toString();
std::cout << "isVolumePierced: " << axisPropagationBinaryWithSeeds3dAlgo.outputMeasurement()->isVolumePierced( ) ;
foam_sep = imagedev.read_vip_image(imagedev_data.get_image_path("foam_sep.vip"))

axis_propagation_binary_with_seeds_3d_algo = imagedev.AxisPropagationBinaryWithSeeds3d()
axis_propagation_binary_with_seeds_3d_algo.input_image = foam_sep
axis_propagation_binary_with_seeds_3d_algo.mask_and_seed_values = [255, -1024]
axis_propagation_binary_with_seeds_3d_algo.maximum_threshold = 128
axis_propagation_binary_with_seeds_3d_algo.axis = imagedev.AxisPropagationBinaryWithSeeds3d.X_AXIS
axis_propagation_binary_with_seeds_3d_algo.propagation_direction = imagedev.AxisPropagationBinaryWithSeeds3d.MIN_TO_MAX
axis_propagation_binary_with_seeds_3d_algo.execute()

print("output_binary_image:", str(axis_propagation_binary_with_seeds_3d_algo.output_binary_image))
print("isVolumePierced: ", str(axis_propagation_binary_with_seeds_3d_algo.output_measurement.is_volume_pierced()))
ImageView foam_sep = Data.ReadVipImage( @"Data/images/foam_sep.vip" );

AxisPropagationBinaryWithSeeds3d axisPropagationBinaryWithSeeds3dAlgo = new AxisPropagationBinaryWithSeeds3d
{
    inputImage = foam_sep,
    maskAndSeedValues = new int[]{255, -1024},
    maximumThreshold = 128,
    axis = AxisPropagationBinaryWithSeeds3d.Axis.X_AXIS,
    propagationDirection = AxisPropagationBinaryWithSeeds3d.PropagationDirection.MIN_TO_MAX
};
axisPropagationBinaryWithSeeds3dAlgo.Execute();

Console.WriteLine( "outputBinaryImage:" + axisPropagationBinaryWithSeeds3dAlgo.outputBinaryImage.ToString() );
Console.WriteLine( "isVolumePierced: " + axisPropagationBinaryWithSeeds3dAlgo.outputMeasurement.isVolumePierced( ) );

Function Examples

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

auto result = axisPropagationBinaryWithSeeds3d( foam_sep, {255, -1024}, 128, AxisPropagationBinaryWithSeeds3d::Axis::X_AXIS, AxisPropagationBinaryWithSeeds3d::PropagationDirection::MIN_TO_MAX );

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

result_output_binary_image, result_output_measurement = imagedev.axis_propagation_binary_with_seeds_3d(foam_sep, [255, -1024], 128, imagedev.AxisPropagationBinaryWithSeeds3d.X_AXIS, imagedev.AxisPropagationBinaryWithSeeds3d.MIN_TO_MAX)

print("output_binary_image:", str(result_output_binary_image))
print("isVolumePierced: ", str(result_output_measurement.is_volume_pierced()))
ImageView foam_sep = Data.ReadVipImage( @"Data/images/foam_sep.vip" );

Processing.AxisPropagationBinaryWithSeeds3dOutput result = Processing.AxisPropagationBinaryWithSeeds3d( foam_sep, new int[]{255, -1024}, 128, AxisPropagationBinaryWithSeeds3d.Axis.X_AXIS, AxisPropagationBinaryWithSeeds3d.PropagationDirection.MIN_TO_MAX );

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