AxisPropagationLabelWithSeeds3d
Simulates the propagation through a phase of a three-dimensional image and computes a label image representing separately the connected and unconnected voxels of this phase.
Access to parameter description
For an introduction:
A label output image represents the connected and disconnected areas:
A measurement output object contains statistics about the connected and disconnected areas of the selected phase 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:
See also
Access to parameter description
For an introduction:
- section Image Analysis
- section Propagation
A label output image represents the connected and disconnected areas:
- Label 0: not in the selected phase
- Label 1: in the selected phase and connected with the seeds
- Label 2: in the selected phase and not connected with the seeds
A measurement output object contains statistics about the connected and disconnected areas of the selected phase 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:
- The voxel is connected (adjacent) to a voxel already 'propagated'.
- X is different from the first maskAndSeedValues value.
- X is greater or equal to the second maskAndSeedValues value.
- X is smaller or equal to the maximumThreshold value.
See also
Function Syntax
This function returns a AxisPropagationLabelWithSeeds3dOutput structure containing outputLabelImage and outputMeasurement.
// Output structure of the axisPropagationLabelWithSeeds3d function. struct AxisPropagationLabelWithSeeds3dOutput { /// The binary output image representing the propagation within the selected phase. A void image means that there is no connection through the selected axis. Its dimensions are forced to the same values as the input. std::shared_ptr< iolink::ImageView > outputLabelImage; /// The output measurement result. AxisPropagationLabel3dMsr::Ptr outputMeasurement; }; // Function prototype
AxisPropagationLabelWithSeeds3dOutput axisPropagationLabelWithSeeds3d( std::shared_ptr< iolink::ImageView > inputImage, iolink::Vector2i32 maskAndSeedValues, int32_t maximumThreshold, AxisPropagationLabelWithSeeds3d::Axis axis, AxisPropagationLabelWithSeeds3d::PropagationDirection propagationDirection, std::shared_ptr< iolink::ImageView > outputLabelImage = NULL, AxisPropagationLabel3dMsr::Ptr outputMeasurement = NULL );
This function returns a tuple containing output_label_image and output_measurement.
// Function prototype. axis_propagation_label_with_seeds_3d( input_image, mask_and_seed_values = [255, -1024], maximum_threshold = 128, axis = AxisPropagationLabelWithSeeds3d.Axis.Z_AXIS, propagation_direction = AxisPropagationLabelWithSeeds3d.PropagationDirection.MIN_TO_MAX, output_label_image = None, output_measurement = None )
This function returns a AxisPropagationLabelWithSeeds3dOutput structure containing outputLabelImage and outputMeasurement.
/// Output structure of the AxisPropagationLabelWithSeeds3d function. public struct AxisPropagationLabelWithSeeds3dOutput { /// /// The binary output image representing the propagation within the selected phase. A void image means that there is no connection through the selected axis. Its dimensions are forced to the same values as the input. /// public IOLink.ImageView outputLabelImage; /// The output measurement result. public AxisPropagationLabel3dMsr outputMeasurement; }; // Function prototype. public static AxisPropagationLabelWithSeeds3dOutput AxisPropagationLabelWithSeeds3d( IOLink.ImageView inputImage, int[] maskAndSeedValues = null, Int32 maximumThreshold = 128, AxisPropagationLabelWithSeeds3d.Axis axis = ImageDev.AxisPropagationLabelWithSeeds3d.Axis.Z_AXIS, AxisPropagationLabelWithSeeds3d.PropagationDirection propagationDirection = ImageDev.AxisPropagationLabelWithSeeds3d.PropagationDirection.MIN_TO_MAX, IOLink.ImageView outputLabelImage = null, AxisPropagationLabel3dMsr outputMeasurement = null );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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 | |||||||
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} | |||||||
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 | |||||||
axis |
The axis along which the propagation is performed.
|
Enumeration | Z_AXIS | ||||||||
propagationDirection |
The direction in which the propagation is performed.
|
Enumeration | MIN_TO_MAX | ||||||||
outputLabelImage |
The binary output image representing the propagation within the selected phase. A void image means that there is no connection through the selected axis. Its dimensions are forced to the same values as the input. | Image | nullptr | ||||||||
outputMeasurement |
The output measurement result. | AxisPropagationLabel3dMsr | nullptr |
Parameter Name | Description | Type | Supported Values | Default Value | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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 | |||||||
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] | |||||||
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 | |||||||
axis |
The axis along which the propagation is performed.
|
enumeration | Z_AXIS | ||||||||
propagation_direction |
The direction in which the propagation is performed.
|
enumeration | MIN_TO_MAX | ||||||||
output_label_image |
The binary output image representing the propagation within the selected phase. A void image means that there is no connection through the selected axis. Its dimensions are forced to the same values as the input. | image | None | ||||||||
output_measurement |
The output measurement result. | AxisPropagationLabel3dMsr | None |
Parameter Name | Description | Type | Supported Values | Default Value | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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 | |||||||
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} | |||||||
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 | |||||||
axis |
The axis along which the propagation is performed.
|
Enumeration | Z_AXIS | ||||||||
propagationDirection |
The direction in which the propagation is performed.
|
Enumeration | MIN_TO_MAX | ||||||||
outputLabelImage |
The binary output image representing the propagation within the selected phase. A void image means that there is no connection through the selected axis. Its dimensions are forced to the same values as the input. | Image | null | ||||||||
outputMeasurement |
The output measurement result. | AxisPropagationLabel3dMsr | null |
Object Examples
auto foam_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam_sep.vip" ); AxisPropagationLabelWithSeeds3d axisPropagationLabelWithSeeds3dAlgo; axisPropagationLabelWithSeeds3dAlgo.setInputImage( foam_sep ); axisPropagationLabelWithSeeds3dAlgo.setMaskAndSeedValues( {255, -1024} ); axisPropagationLabelWithSeeds3dAlgo.setMaximumThreshold( 128 ); axisPropagationLabelWithSeeds3dAlgo.setAxis( AxisPropagationLabelWithSeeds3d::Axis::X_AXIS ); axisPropagationLabelWithSeeds3dAlgo.setPropagationDirection( AxisPropagationLabelWithSeeds3d::PropagationDirection::MIN_TO_MAX ); axisPropagationLabelWithSeeds3dAlgo.execute(); std::cout << "outputLabelImage:" << axisPropagationLabelWithSeeds3dAlgo.outputLabelImage()->toString(); std::cout << "poreVolume: " << axisPropagationLabelWithSeeds3dAlgo.outputMeasurement()->poreVolume( ) ;
foam_sep = imagedev.read_vip_image(imagedev_data.get_image_path("foam_sep.vip")) axis_propagation_label_with_seeds_3d_algo = imagedev.AxisPropagationLabelWithSeeds3d() axis_propagation_label_with_seeds_3d_algo.input_image = foam_sep axis_propagation_label_with_seeds_3d_algo.mask_and_seed_values = [255, -1024] axis_propagation_label_with_seeds_3d_algo.maximum_threshold = 128 axis_propagation_label_with_seeds_3d_algo.axis = imagedev.AxisPropagationLabelWithSeeds3d.X_AXIS axis_propagation_label_with_seeds_3d_algo.propagation_direction = imagedev.AxisPropagationLabelWithSeeds3d.MIN_TO_MAX axis_propagation_label_with_seeds_3d_algo.execute() print( "output_label_image:", str( axis_propagation_label_with_seeds_3d_algo.output_label_image ) ) print( "poreVolume: ", str( axis_propagation_label_with_seeds_3d_algo.output_measurement.pore_volume( ) ) )
ImageView foam_sep = Data.ReadVipImage( @"Data/images/foam_sep.vip" ); AxisPropagationLabelWithSeeds3d axisPropagationLabelWithSeeds3dAlgo = new AxisPropagationLabelWithSeeds3d { inputImage = foam_sep, maskAndSeedValues = new int[]{255, -1024}, maximumThreshold = 128, axis = AxisPropagationLabelWithSeeds3d.Axis.X_AXIS, propagationDirection = AxisPropagationLabelWithSeeds3d.PropagationDirection.MIN_TO_MAX }; axisPropagationLabelWithSeeds3dAlgo.Execute(); Console.WriteLine( "outputLabelImage:" + axisPropagationLabelWithSeeds3dAlgo.outputLabelImage.ToString() ); Console.WriteLine( "poreVolume: " + axisPropagationLabelWithSeeds3dAlgo.outputMeasurement.poreVolume( ) );
Function Examples
auto foam_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam_sep.vip" ); auto result = axisPropagationLabelWithSeeds3d( foam_sep, {255, -1024}, 128, AxisPropagationLabelWithSeeds3d::Axis::X_AXIS, AxisPropagationLabelWithSeeds3d::PropagationDirection::MIN_TO_MAX ); std::cout << "outputLabelImage:" << result.outputLabelImage->toString(); std::cout << "poreVolume: " << result.outputMeasurement->poreVolume( ) ;
foam_sep = imagedev.read_vip_image(imagedev_data.get_image_path("foam_sep.vip")) result_output_label_image, result_output_measurement = imagedev.axis_propagation_label_with_seeds_3d( foam_sep, [255, -1024], 128, imagedev.AxisPropagationLabelWithSeeds3d.X_AXIS, imagedev.AxisPropagationLabelWithSeeds3d.MIN_TO_MAX ) print( "output_label_image:", str( result_output_label_image ) ) print( "poreVolume: ", str( result_output_measurement.pore_volume( ) ) )
ImageView foam_sep = Data.ReadVipImage( @"Data/images/foam_sep.vip" ); Processing.AxisPropagationLabelWithSeeds3dOutput result = Processing.AxisPropagationLabelWithSeeds3d( foam_sep, new int[]{255, -1024}, 128, AxisPropagationLabelWithSeeds3d.Axis.X_AXIS, AxisPropagationLabelWithSeeds3d.PropagationDirection.MIN_TO_MAX ); Console.WriteLine( "outputLabelImage:" + result.outputLabelImage.ToString() ); Console.WriteLine( "poreVolume: " + result.outputMeasurement.poreVolume( ) );