ExpandLabelsOnBackground
Performs an iterative dilation of a label image, until the entire background is filled by labels.
Access to parameter description
For an introduction:
It works with 2D and 3D images.
Figure 1. Example of label expansion on background: (a) input label image,
(b) image after label expansion
See also
Access to parameter description
For an introduction:
- section Mathematical Morphology
- section Introduction To Dilation
It works with 2D and 3D images.
(a) |
(b) |
See also
Function Syntax
This function returns outputLabelImage.
// Function prototype
std::shared_ptr< iolink::ImageView > expandLabelsOnBackground( std::shared_ptr< iolink::ImageView > inputLabelImage, ExpandLabelsOnBackground::Neighborhood neighborhood, std::shared_ptr< iolink::ImageView > outputLabelImage = nullptr );
This function returns outputLabelImage.
// Function prototype. expand_labels_on_background(input_label_image: idt.ImageType, neighborhood: ExpandLabelsOnBackground.Neighborhood = ExpandLabelsOnBackground.Neighborhood.CONNECTIVITY_26, output_label_image: idt.ImageType = None) -> idt.ImageType
This function returns outputLabelImage.
// Function prototype. public static IOLink.ImageView ExpandLabelsOnBackground( IOLink.ImageView inputLabelImage, ExpandLabelsOnBackground.Neighborhood neighborhood = ImageDev.ExpandLabelsOnBackground.Neighborhood.CONNECTIVITY_26, IOLink.ImageView outputLabelImage = null );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
inputLabelImage |
The input label image. | Image | Label | nullptr | |||||||
neighborhood |
The 3D neighborhood configuration. This parameter is ignored with a 2D input image.
|
Enumeration | CONNECTIVITY_26 | ||||||||
outputLabelImage |
The output label image. Its dimensions are forced to the same values as the input image. | Image | nullptr |
Parameter Name | Description | Type | Supported Values | Default Value | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
input_label_image |
The input label image. | image | Label | None | |||||||
neighborhood |
The 3D neighborhood configuration. This parameter is ignored with a 2D input image.
|
enumeration | CONNECTIVITY_26 | ||||||||
output_label_image |
The output label image. Its dimensions are forced to the same values as the input image. | image | None |
Parameter Name | Description | Type | Supported Values | Default Value | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
inputLabelImage |
The input label image. | Image | Label | null | |||||||
neighborhood |
The 3D neighborhood configuration. This parameter is ignored with a 2D input image.
|
Enumeration | CONNECTIVITY_26 | ||||||||
outputLabelImage |
The output label image. Its dimensions are forced to the same values as the input image. | Image | null |
Object Examples
auto foam_sep_label = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam_sep_label.vip" ); ExpandLabelsOnBackground expandLabelsOnBackgroundAlgo; expandLabelsOnBackgroundAlgo.setInputLabelImage( foam_sep_label ); expandLabelsOnBackgroundAlgo.setNeighborhood( ExpandLabelsOnBackground::Neighborhood::CONNECTIVITY_26 ); expandLabelsOnBackgroundAlgo.execute(); std::cout << "outputLabelImage:" << expandLabelsOnBackgroundAlgo.outputLabelImage()->toString();
foam_sep_label = imagedev.read_vip_image(imagedev_data.get_image_path("foam_sep_label.vip")) expand_labels_on_background_algo = imagedev.ExpandLabelsOnBackground() expand_labels_on_background_algo.input_label_image = foam_sep_label expand_labels_on_background_algo.neighborhood = imagedev.ExpandLabelsOnBackground.CONNECTIVITY_26 expand_labels_on_background_algo.execute() print("output_label_image:", str(expand_labels_on_background_algo.output_label_image))
ImageView foam_sep_label = Data.ReadVipImage( @"Data/images/foam_sep_label.vip" ); ExpandLabelsOnBackground expandLabelsOnBackgroundAlgo = new ExpandLabelsOnBackground { inputLabelImage = foam_sep_label, neighborhood = ExpandLabelsOnBackground.Neighborhood.CONNECTIVITY_26 }; expandLabelsOnBackgroundAlgo.Execute(); Console.WriteLine( "outputLabelImage:" + expandLabelsOnBackgroundAlgo.outputLabelImage.ToString() );
Function Examples
auto foam_sep_label = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam_sep_label.vip" ); auto result = expandLabelsOnBackground( foam_sep_label, ExpandLabelsOnBackground::Neighborhood::CONNECTIVITY_26 ); std::cout << "outputLabelImage:" << result->toString();
foam_sep_label = imagedev.read_vip_image(imagedev_data.get_image_path("foam_sep_label.vip")) result = imagedev.expand_labels_on_background(foam_sep_label, imagedev.ExpandLabelsOnBackground.CONNECTIVITY_26) print("output_label_image:", str(result))
ImageView foam_sep_label = Data.ReadVipImage( @"Data/images/foam_sep_label.vip" ); IOLink.ImageView result = Processing.ExpandLabelsOnBackground( foam_sep_label, ExpandLabelsOnBackground.Neighborhood.CONNECTIVITY_26 ); Console.WriteLine( "outputLabelImage:" + result.ToString() );