ImageDev

LabelCountByRegion

Computes, for each region of a first label image, the number of objects contained in a second label image.

Access to parameter description

This algorithm can be used, for instance, to compute the number of markers contained in each cell of a life science image, or the number of inclusions in each phase of a material science image.
If the region image is a binary image, it is considered as a single region and the algorithm amounts to computing the number of objects masked by this image.
If the region image is a label image, the number of objects is given for each label of the region image.

See also

Function Syntax

This function returns outputMeasurement.
// Function prototype
LabelCountByRegionMsr::Ptr labelCountByRegion( std::shared_ptr< iolink::ImageView > inputObjectImage, std::shared_ptr< iolink::ImageView > inputLabelImage, LabelCountByRegionMsr::Ptr outputMeasurement = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputObjectImage
The input binary or label image representing the regions to be analyzed. Image Binary or Label nullptr
input
inputLabelImage
The input label image containing the particles to be counted. This image must have same dimensions as the region input image. Image Label nullptr
output
outputMeasurement
The output measurement result providing one count per region. LabelCountByRegionMsr nullptr

Object Examples

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

LabelCountByRegion labelCountByRegionAlgo;
labelCountByRegionAlgo.setInputObjectImage( polystyrene_sep_label );
labelCountByRegionAlgo.setInputLabelImage( polystyrene_sep_label );
labelCountByRegionAlgo.execute();

std::cout << "region: " << labelCountByRegionAlgo.outputMeasurement()->region( 0 ) ;

Function Examples

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

auto result = labelCountByRegion( polystyrene_sep_label, polystyrene_sep_label );

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