ImageDev

PercolationThreshold3d

Computes the intensity level spread following an axis of propagation in a three-dimensional image.

Access to parameter description

This algorithm determines the maximum intensity that can be "pierced". It can be only applied on grayscale images.

A measurement output object contains information about the propagation, indicating if the volume is pierced and the detected percolation threshold.

The maskAndSeedValues parameter identifies 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 conditions: The searchRange parameter defines the range inside which the percolation threshold is searched.

See also

Function Syntax

This function returns outputMeasurement.
// Function prototype
PercolationThreshold3dMsr::Ptr percolationThreshold3d( std::shared_ptr< iolink::ImageView > inputImage, iolink::Vector2i32 maskAndSeedValues, iolink::Vector2i32 searchRange, PercolationThreshold3d::Axis axis, PercolationThreshold3d::Neighborhood neighborhood, PercolationThreshold3dMsr::Ptr outputMeasurement = NULL );
This function returns outputMeasurement.
// Function prototype.
percolation_threshold_3d( input_image,
                          mask_and_seed_values = [0, 255],
                          search_range = [0, 255],
                          axis = PercolationThreshold3d.Axis.X_AXIS,
                          neighborhood = PercolationThreshold3d.Neighborhood.CONNECTIVITY_26,
                          output_measurement = None )
This function returns outputMeasurement.
// Function prototype.
public static PercolationThreshold3dMsr
PercolationThreshold3d( IOLink.ImageView inputImage,
                        int[] maskAndSeedValues = null,
                        int[] searchRange = null,
                        PercolationThreshold3d.Axis axis = ImageDev.PercolationThreshold3d.Axis.X_AXIS,
                        PercolationThreshold3d.Neighborhood neighborhood = ImageDev.PercolationThreshold3d.Neighborhood.CONNECTIVITY_26,
                        PercolationThreshold3dMsr outputMeasurement = null );

Class Syntax

Parameters

Class Name PercolationThreshold3d

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input grayscale or color image. Image Binary, Label, Grayscale or Multispectral 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. Vector2i32 Any value {0, 255}
input
searchRange
The range inside which the percolation threshold is searched. Vector2i32 Any value {0, 255}
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 X_AXIS
input
neighborhood
The 3D neighborhood configuration.
CONNECTIVITY_6 The structuring element is composed of voxels with a common face with the voxel of interest.
CONNECTIVITY_18 The structuring element is composed of voxels with at least one common edge.
CONNECTIVITY_26 The structuring element is a full cube.
Enumeration CONNECTIVITY_26
output
outputMeasurement
The output measurement result. PercolationThreshold3dMsr nullptr

Object Examples

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

PercolationThreshold3d percolationThreshold3dAlgo;
percolationThreshold3dAlgo.setInputImage( foam );
percolationThreshold3dAlgo.setMaskAndSeedValues( {0, 255} );
percolationThreshold3dAlgo.setSearchRange( {0, 255} );
percolationThreshold3dAlgo.setAxis( PercolationThreshold3d::Axis::X_AXIS );
percolationThreshold3dAlgo.setNeighborhood( PercolationThreshold3d::Neighborhood::CONNECTIVITY_26 );
percolationThreshold3dAlgo.execute();

std::cout << "isVolumePierced: " << percolationThreshold3dAlgo.outputMeasurement()->isVolumePierced( ) ;
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

percolation_threshold_3d_algo = imagedev.PercolationThreshold3d()
percolation_threshold_3d_algo.input_image = foam
percolation_threshold_3d_algo.mask_and_seed_values = [0, 255]
percolation_threshold_3d_algo.search_range = [0, 255]
percolation_threshold_3d_algo.axis = imagedev.PercolationThreshold3d.X_AXIS
percolation_threshold_3d_algo.neighborhood = imagedev.PercolationThreshold3d.CONNECTIVITY_26
percolation_threshold_3d_algo.execute()

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

PercolationThreshold3d percolationThreshold3dAlgo = new PercolationThreshold3d
{
    inputImage = foam,
    maskAndSeedValues = new int[]{0, 255},
    searchRange = new int[]{0, 255},
    axis = PercolationThreshold3d.Axis.X_AXIS,
    neighborhood = PercolationThreshold3d.Neighborhood.CONNECTIVITY_26
};
percolationThreshold3dAlgo.Execute();

Console.WriteLine( "isVolumePierced: " + percolationThreshold3dAlgo.outputMeasurement.isVolumePierced( ) );

Function Examples

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

auto result = percolationThreshold3d( foam, {0, 255}, {0, 255}, PercolationThreshold3d::Axis::X_AXIS, PercolationThreshold3d::Neighborhood::CONNECTIVITY_26 );

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

result = imagedev.percolation_threshold_3d( foam, [0, 255], [0, 255], imagedev.PercolationThreshold3d.X_AXIS, imagedev.PercolationThreshold3d.CONNECTIVITY_26 )

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

PercolationThreshold3dMsr result = Processing.PercolationThreshold3d( foam, new int[]{0, 255}, new int[]{0, 255}, PercolationThreshold3d.Axis.X_AXIS, PercolationThreshold3d.Neighborhood.CONNECTIVITY_26 );

Console.WriteLine(  "isVolumePierced: " + result.isVolumePierced( )  );