ImageDev

PorosityPercentage3d

Measures the enclosed porosity percentage inside a volume of interest of a three-dimensional binary image, slice by slice, along the Z axis.

Access to parameter description

For an introduction: Porosity is a measurement of the void spaces in a material, and represents the fraction of void volume over the total volume.

This algorithm computes the mean two-dimensional porosity $Po$ over the XY slices of the binary input volume as follows:
$$ Po=\frac{100}{Z}\sum_{z=0}^{Z-1} \frac{Ar(F_z)-Ar(I_z)}{Ar(F_z)} $$ where Note: This algorithm considers only enclosed porosity and ignores void spaces that are not surrounded by solid.

See also

Function Syntax

This function returns the outputMeasurement output parameter.
// Function prototype.
PorosityPercentageMsr::Ptr
porosityPercentage3d( std::shared_ptr< iolink::ImageView > inputBinaryImage,
                      std::shared_ptr< iolink::ImageView > inputMaskImage,
                      PorosityPercentageMsr::Ptr outputMeasurement = NULL );
This function returns the outputMeasurement output parameter.
// Function prototype.
porosity_percentage_3d( input_binary_image, input_mask_image, output_measurement = None )
This function returns the outputMeasurement output parameter.
// Function prototype.
public static PorosityPercentageMsr
PorosityPercentage3d( IOLink.ImageView inputBinaryImage,
                      IOLink.ImageView inputMaskImage,
                      PorosityPercentageMsr outputMeasurement = null );

Class Syntax

Parameters

Class Name PorosityPercentage3d

Parameter Name Description Type Supported Values Default Value
input
inputBinaryImage
The 3D binary input image. Image Binary nullptr
input
inputMaskImage
The binary image defining the volume of interest. The measurement is computed from voxels having a value of 1 in this image. If it equals null, the computation is performed from all voxels of the input image. It must have same dimensions as the input image. Image Binary nullptr
output
outputMeasurement
The output measurement result. PorosityPercentageMsr nullptr

Object Examples

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

PorosityPercentage3d porosityPercentage3dAlgo;
porosityPercentage3dAlgo.setInputBinaryImage( foam_sep );
porosityPercentage3dAlgo.setInputMaskImage( foam_sep );
porosityPercentage3dAlgo.execute();

std::cout << "percentage: " << porosityPercentage3dAlgo.outputMeasurement()->percentage( ) ;
foam_sep = imagedev.read_vip_image(imagedev_data.get_image_path("foam_sep.vip"))

porosity_percentage_3d_algo = imagedev.PorosityPercentage3d()
porosity_percentage_3d_algo.input_binary_image = foam_sep
porosity_percentage_3d_algo.input_mask_image = foam_sep
porosity_percentage_3d_algo.execute()

print( 
print("percentage: ", porosity_percentage_3d_algo.output_measurement.percentage( ) ) );
ImageView foam_sep = Data.ReadVipImage( @"Data/images/foam_sep.vip" );

PorosityPercentage3d porosityPercentage3dAlgo = new PorosityPercentage3d
{
    inputBinaryImage = foam_sep,
    inputMaskImage = foam_sep
};
porosityPercentage3dAlgo.Execute();

Console.WriteLine( "percentage: " + porosityPercentage3dAlgo.outputMeasurement.percentage( ) );

Function Examples

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

auto result = porosityPercentage3d( foam_sep, foam_sep );

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

result = imagedev.porosity_percentage_3d( foam_sep, foam_sep )

print( "percentage: ", result.percentage( ) );
ImageView foam_sep = Data.ReadVipImage( @"Data/images/foam_sep.vip" );

PorosityPercentageMsr result = Processing.PorosityPercentage3d( foam_sep, foam_sep );

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