ImageDev

BorderKill

Removes the objects connected to the borders of a segmented image.

Access to parameter description

This command is deprecated, it will be removed in ImageDev 2024.2.
You can use KillBorder instead.

For an introduction: This algorithm removes all the objects touching the borders of the image.
Objects connected to the image borders are identified using a numerical reconstruction from markers made of pixels of the image frame.

<b> Figure 1. </b> Illustration of the BorderKill algorithm
Figure 1. Illustration of the BorderKill algorithm

See also
See related examples

Function Syntax

This function returns outputObjectImage.
// Function prototype
std::shared_ptr< iolink::ImageView > borderKill( std::shared_ptr< iolink::ImageView > inputObjectImage, BorderKill::Neighborhood neighborhood, std::shared_ptr< iolink::ImageView > outputObjectImage = nullptr );
This function returns outputObjectImage.
// Function prototype.
border_kill(input_object_image: idt.ImageType,
            neighborhood: BorderKill.Neighborhood = BorderKill.Neighborhood.CONNECTIVITY_26,
            output_object_image: idt.ImageType = None) -> idt.ImageType
This function returns outputObjectImage.
// Function prototype.
public static IOLink.ImageView
BorderKill( IOLink.ImageView inputObjectImage,
            BorderKill.Neighborhood neighborhood = ImageDev.BorderKill.Neighborhood.CONNECTIVITY_26,
            IOLink.ImageView outputObjectImage = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputObjectImage
The input binary or label image. Image Binary or Label nullptr
input
neighborhood
The 3D neighborhood configuration. This parameter is ignored with a 2D input image.
CONNECTIVITY_6 The structuring element is composed of voxels with a common face with the voxel of interest.
CONNECTIVITY_18 The structuring element is composed of voxels with at least one common edge.
CONNECTIVITY_26 The structuring element is a full cube.
Enumeration CONNECTIVITY_26
output
outputObjectImage
The output binary or label image. Its dimensions and type are forced to the same values as the input. Image nullptr
Parameter Name Description Type Supported Values Default Value
input
input_object_image
The input binary or label image. image Binary or Label None
input
neighborhood
The 3D neighborhood configuration. This parameter is ignored with a 2D input image.
CONNECTIVITY_6 The structuring element is composed of voxels with a common face with the voxel of interest.
CONNECTIVITY_18 The structuring element is composed of voxels with at least one common edge.
CONNECTIVITY_26 The structuring element is a full cube.
enumeration CONNECTIVITY_26
output
output_object_image
The output binary or label image. Its dimensions and type are forced to the same values as the input. image None
Parameter Name Description Type Supported Values Default Value
input
inputObjectImage
The input binary or label image. Image Binary or Label null
input
neighborhood
The 3D neighborhood configuration. This parameter is ignored with a 2D input image.
CONNECTIVITY_6 The structuring element is composed of voxels with a common face with the voxel of interest.
CONNECTIVITY_18 The structuring element is composed of voxels with at least one common edge.
CONNECTIVITY_26 The structuring element is a full cube.
Enumeration CONNECTIVITY_26
output
outputObjectImage
The output binary or label image. Its dimensions and type are forced to the same values as the input. Image null

Object Examples

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

BorderKill borderKillAlgo;
borderKillAlgo.setInputObjectImage( foam_sep );
borderKillAlgo.setNeighborhood( BorderKill::Neighborhood::CONNECTIVITY_26 );
borderKillAlgo.execute();

std::cout << "outputObjectImage:" << borderKillAlgo.outputObjectImage()->toString();
foam_sep = imagedev.read_vip_image(imagedev_data.get_image_path("foam_sep.vip"))

border_kill_algo = imagedev.BorderKill()
border_kill_algo.input_object_image = foam_sep
border_kill_algo.neighborhood = imagedev.BorderKill.CONNECTIVITY_26
border_kill_algo.execute()

print("output_object_image:", str(border_kill_algo.output_object_image))
ImageView foam_sep = Data.ReadVipImage( @"Data/images/foam_sep.vip" );

BorderKill borderKillAlgo = new BorderKill
{
    inputObjectImage = foam_sep,
    neighborhood = BorderKill.Neighborhood.CONNECTIVITY_26
};
borderKillAlgo.Execute();

Console.WriteLine( "outputObjectImage:" + borderKillAlgo.outputObjectImage.ToString() );

Function Examples

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

auto result = borderKill( foam_sep, BorderKill::Neighborhood::CONNECTIVITY_26 );

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

result = imagedev.border_kill(foam_sep, imagedev.BorderKill.CONNECTIVITY_26)

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

IOLink.ImageView result = Processing.BorderKill( foam_sep, BorderKill.Neighborhood.CONNECTIVITY_26 );

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