ImageDev

LabelInterfaces

Generates a binary image containing points having a minimum number of different neighbors in a label input image.

Access to parameter description

This algorithm computes all points of a label image that have at least a user-defined number of different neighbors (label value greater than 0). Then this algorithm generates a binary image highlighting all these points.
This algorithm can search points everywhere in the input image or only in the background (where intensity equals 0), which is useful for boundaries of a MarkerBasedWatershed result image.

See also

Function Syntax

This function returns outputBinaryImage.
// Function prototype
std::shared_ptr< iolink::ImageView > labelInterfaces( std::shared_ptr< iolink::ImageView > inputLabelImage, int32_t phaseNumber, LabelInterfaces::OnlyBlackVoxels onlyBlackVoxels, LabelInterfaces::Neighborhood neighborhood, std::shared_ptr< iolink::ImageView > outputBinaryImage = nullptr );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputLabelImage
The input label image. Image Label nullptr
input
phaseNumber
The minimum number of different neighbor labels to select a point. Int32 >=0 3
input
onlyBlackVoxels
The way to look for interface points.
NO Interface points are searched everywhere in the input image.
YES Interface points are searched only in the image background (where intensity equals 0).
Enumeration YES
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
outputBinaryImage
The output binary image. Its dimensions are forced to the same values as the input. Image nullptr

Object Examples

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

LabelInterfaces labelInterfacesAlgo;
labelInterfacesAlgo.setInputLabelImage( foam_sep_label );
labelInterfacesAlgo.setPhaseNumber( 3 );
labelInterfacesAlgo.setOnlyBlackVoxels( LabelInterfaces::OnlyBlackVoxels::YES );
labelInterfacesAlgo.setNeighborhood( LabelInterfaces::Neighborhood::CONNECTIVITY_26 );
labelInterfacesAlgo.execute();

std::cout << "outputBinaryImage:" << labelInterfacesAlgo.outputBinaryImage()->toString();

Function Examples

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

auto result = labelInterfaces( foam_sep_label, 3, LabelInterfaces::OnlyBlackVoxels::YES, LabelInterfaces::Neighborhood::CONNECTIVITY_26 );

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