ImageDev

FillHoles3d

Fills the holes inside particles of a three-dimensional binary image.

Access to parameter description

For an introduction: This algorithm fills the holes inside particles, irrespective of their size.
Holes inside objects are filled using a numerical reconstruction applied on the complement of the input image, from markers made of voxels of the image frame.

<b> Figure 1.</b> Illustration of the hole filling algorithm
Figure 1. Illustration of the hole filling algorithm

Note: Since the reconstruction is applied on the input image complement, selecting a 6-neighbor connectivity fills holes connected to the background with a 26-neighbor connectivity.

See also

Function Syntax

This function returns outputObjectImage.
// Function prototype
std::shared_ptr< iolink::ImageView > fillHoles3d( std::shared_ptr< iolink::ImageView > inputObjectImage, FillHoles3d::Neighborhood neighborhood, std::shared_ptr< iolink::ImageView > outputObjectImage = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputObjectImage
The 3D binary input 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 binary output image. Its dimensions are forced to the same values as the input. Image nullptr

Object Examples

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

FillHoles3d fillHoles3dAlgo;
fillHoles3dAlgo.setInputObjectImage( foam_sep );
fillHoles3dAlgo.setNeighborhood( FillHoles3d::Neighborhood::CONNECTIVITY_26 );
fillHoles3dAlgo.execute();

std::cout << "outputObjectImage:" << fillHoles3dAlgo.outputObjectImage()->toString();

Function Examples

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

auto result = fillHoles3d( foam_sep, FillHoles3d::Neighborhood::CONNECTIVITY_26 );

std::cout << "outputObjectImage:" << result->toString();