Loading [MathJax]/jax/output/CommonHTML/jax.js
ImageDev

VolumeFractionByLabel

Computes the volume fraction occupied by each object or region of a segmented image.

Access to parameter description

For an introduction: section Image Analysis.

This algorithm computes the volume fraction of a binary or label image; a mask can be used or not used. The mask input is optional. If no mask is provided, the entire image is considered as the mask.

It outputs a measurement object indexed by label (index 0 corresponds to label 1) and, in case of a time series, by time step. It contains the following measurements: where: See also

Function Syntax

This function returns outputMeasurement.
// Function prototype
VolumeFractionByLabelMsr::Ptr volumeFractionByLabel( std::shared_ptr< iolink::ImageView > inputObjectImage, std::shared_ptr< iolink::ImageView > inputMaskImage, VolumeFractionByLabelMsr::Ptr outputMeasurement = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputObjectImage
The binary or label input image. Image Binary or Label nullptr
input
inputMaskImage
The binary input image used as a mask (optional). Pixels having a zero value in the mask are not taken into account in the computations. If equal to null, the entire input image is considered as the mask. This image must have same dimensions as the main input image. Image Binary nullptr
output
outputMeasurement
The output measurement results for each label. VolumeFractionByLabelMsr nullptr

Object Examples

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

VolumeFractionByLabel volumeFractionByLabelAlgo;
volumeFractionByLabelAlgo.setInputObjectImage( polystyrene_sep_label );
volumeFractionByLabelAlgo.setInputMaskImage( polystyrene_sep );
volumeFractionByLabelAlgo.execute();

std::cout << "volumeFraction: " << volumeFractionByLabelAlgo.outputMeasurement()->volumeFraction( 0 , 0 ) ;

Function Examples

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

auto result = volumeFractionByLabel( polystyrene_sep_label, polystyrene_sep );

std::cout << "volumeFraction: " << result->volumeFraction( 0 , 0 ) ;