ImageDev

KillBorder3d

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

Access to parameter description

For an introduction: This algorithm removes all the objects touching the borders of the 3D image.
Objects connected to the label image borders are identified using a numerical reconstruction from markers made of pixels of the image frame. Then we remove these objects from the input image with a logical subtraction.

To reorder labels use ReorderLabels algorithm

<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 > killBorder3d( std::shared_ptr< iolink::ImageView > inputObjectImage, KillBorder3d::Neighborhood neighborhood, std::shared_ptr< iolink::ImageView > outputObjectImage = nullptr );
This function returns outputObjectImage.
// Function prototype.
kill_border_3d(input_object_image: idt.ImageType,
               neighborhood: KillBorder3d.Neighborhood = KillBorder3d.Neighborhood.CONNECTIVITY_26,
               output_object_image: idt.ImageType = None) -> idt.ImageType
This function returns outputObjectImage.
// Function prototype.
public static IOLink.ImageView
KillBorder3d( IOLink.ImageView inputObjectImage,
              KillBorder3d.Neighborhood neighborhood = ImageDev.KillBorder3d.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.
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.
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.
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" );

KillBorder3d killBorder3dAlgo;
killBorder3dAlgo.setInputObjectImage( foam_sep );
killBorder3dAlgo.setNeighborhood( KillBorder3d::Neighborhood::CONNECTIVITY_26 );
killBorder3dAlgo.execute();

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

kill_border_3d_algo = imagedev.KillBorder3d()
kill_border_3d_algo.input_object_image = foam_sep
kill_border_3d_algo.neighborhood = imagedev.KillBorder3d.CONNECTIVITY_26
kill_border_3d_algo.execute()

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

KillBorder3d killBorder3dAlgo = new KillBorder3d
{
    inputObjectImage = foam_sep,
    neighborhood = KillBorder3d.Neighborhood.CONNECTIVITY_26
};
killBorder3dAlgo.Execute();

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

Function Examples

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

auto result = killBorder3d( foam_sep, KillBorder3d::Neighborhood::CONNECTIVITY_26 );

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

result = imagedev.kill_border_3d(foam_sep, imagedev.KillBorder3d.CONNECTIVITY_26)

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

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

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