ImageDev

LabelFiltering

Removes objects from a label image based on measurement criteria.

Access to parameter description

For an introduction: This algorithm applies the criteria defined by the selected filter to the input image. Then it outputs the corresponding filtered label image.

The input filter contains the criteria to preserve objects from the input label image. These criteria are defined by one or several analysis measurements ranges.

If the label input image has a coordinate system unit defined in its calibration property, the filter limit values are expressed in this coordinate system unit.

See also

Function Syntax

This function returns the outputLabelImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
labelFiltering( std::shared_ptr< iolink::ImageView > inputLabelImage,
                std::shared_ptr< iolink::ImageView > inputIntensityImage,
                std::string inputFilter,
                std::shared_ptr< iolink::ImageView > outputLabelImage = NULL );
This function returns the outputLabelImage output parameter.
// Function prototype.
label_filtering( input_label_image,
                 input_intensity_image,
                 input_filter = "",
                 output_label_image = None )
This function returns the outputLabelImage output parameter.
// Function prototype.
public static IOLink.ImageView
LabelFiltering( IOLink.ImageView inputLabelImage,
                IOLink.ImageView inputIntensityImage,
                string inputFilter = "",
                IOLink.ImageView outputLabelImage = null );

Class Syntax

Parameters

Class Name LabelFiltering

Parameter Name Description Type Supported Values Default Value
input
inputLabelImage
The label input image. Image Label nullptr
input
inputIntensityImage
The intensity input image. If it equals null, the label input image will be used as the intensity input image. Image Binary, Label, Grayscale or Multispectral nullptr
input
inputFilter
The input filter formula.
The Label Filtering section details how to create a filter.
Filter ""
output
outputLabelImage
The output label image. Its dimensions and type are forced to the same values as the input. Image nullptr

Object Examples

auto polystyrene_sep_label = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep_label.vip" );
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

LabelFiltering labelFilteringAlgo;
labelFilteringAlgo.setInputLabelImage( polystyrene_sep_label );
labelFilteringAlgo.setInputIntensityImage( polystyrene );
labelFilteringAlgo.setInputFilter( "Area>=3000" );
labelFilteringAlgo.execute();

std::cout << "outputLabelImage:" << labelFilteringAlgo.outputLabelImage()->toString();
polystyrene_sep_label = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_sep_label.vip"))
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

label_filtering_algo = imagedev.LabelFiltering()
label_filtering_algo.input_label_image = polystyrene_sep_label
label_filtering_algo.input_intensity_image = polystyrene
label_filtering_algo.input_filter = "Area>=3000"
label_filtering_algo.execute()

print( "output_label_image:", str( label_filtering_algo.output_label_image ) );
ImageView polystyrene_sep_label = Data.ReadVipImage( @"Data/images/polystyrene_sep_label.vip" );
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

LabelFiltering labelFilteringAlgo = new LabelFiltering
{
    inputLabelImage = polystyrene_sep_label,
    inputIntensityImage = polystyrene,
    inputFilter = "Area>=3000"
};
labelFilteringAlgo.Execute();

Console.WriteLine( "outputLabelImage:" + labelFilteringAlgo.outputLabelImage.ToString() );

Function Examples

auto polystyrene_sep_label = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep_label.vip" );
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

auto result = labelFiltering( polystyrene_sep_label, polystyrene, "Area>=3000" );

std::cout << "outputLabelImage:" << result->toString();
polystyrene_sep_label = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_sep_label.vip"))
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

result = imagedev.label_filtering( polystyrene_sep_label, polystyrene, "Area>=3000" )

print( "output_label_image:", str( result ) );
ImageView polystyrene_sep_label = Data.ReadVipImage( @"Data/images/polystyrene_sep_label.vip" );
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

IOLink.ImageView result = Processing.LabelFiltering( polystyrene_sep_label, polystyrene, "Area>=3000" );

Console.WriteLine( "outputLabelImage:" + result.ToString() );