ImageDev

SelectiveErosion3d

Erodes objects of a three-dimensional binary image conditionally to a local constraint.

Access to parameter description

For an introduction: This algorithm can be applied only on binary images. It is performed iteratively and at each step a foreground voxel is transformed into a background voxel if the number of background voxels in its 26-neighborhood is greater than or equal to a specified threshold.
Using a threshold of 1 amounts to applying a standard morphological erosion.

This operator is smoother than a standard erosion, and softens the appearance of the structuring element in the filtered image.

See also

Function Syntax

This function returns the outputBinaryImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
selectiveErosion3d( std::shared_ptr< iolink::ImageView > inputBinaryImage,
                    uint32_t numberOfIterations,
                    uint32_t threshold,
                    std::shared_ptr< iolink::ImageView > outputBinaryImage = NULL );
This function returns the outputBinaryImage output parameter.
// Function prototype.
selective_erosion_3d( input_binary_image,
                      number_of_iterations = 3,
                      threshold = 14,
                      output_binary_image = None )
This function returns the outputBinaryImage output parameter.
// Function prototype.
public static IOLink.ImageView
SelectiveErosion3d( IOLink.ImageView inputBinaryImage,
                    UInt32 numberOfIterations = 3,
                    UInt32 threshold = 14,
                    IOLink.ImageView outputBinaryImage = null );

Class Syntax

Parameters

Class Name SelectiveErosion3d

Parameter Name Description Type Supported Values Default Value
input
inputBinaryImage
The binary input image. Image Binary nullptr
input
numberOfIterations
The number of iterations. UInt32 >=1 3
input
threshold
The minimum number of background neighbors that is required to transform a foreground voxel into a background one. UInt32 [1, 26] 14
output
outputBinaryImage
The binary output image. Its size and type 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" );

SelectiveErosion3d selectiveErosion3dAlgo;
selectiveErosion3dAlgo.setInputBinaryImage( foam_sep );
selectiveErosion3dAlgo.setNumberOfIterations( 3 );
selectiveErosion3dAlgo.setThreshold( 14 );
selectiveErosion3dAlgo.execute();

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

selective_erosion_3d_algo = imagedev.SelectiveErosion3d()
selective_erosion_3d_algo.input_binary_image = foam_sep
selective_erosion_3d_algo.number_of_iterations = 3
selective_erosion_3d_algo.threshold = 14
selective_erosion_3d_algo.execute()

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

SelectiveErosion3d selectiveErosion3dAlgo = new SelectiveErosion3d
{
    inputBinaryImage = foam_sep,
    numberOfIterations = 3,
    threshold = 14
};
selectiveErosion3dAlgo.Execute();

Console.WriteLine( "outputBinaryImage:" + selectiveErosion3dAlgo.outputBinaryImage.ToString() );

Function Examples

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

auto result = selectiveErosion3d( foam_sep, 3, 14 );

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

result = imagedev.selective_erosion_3d( foam_sep, 3, 14 )

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

IOLink.ImageView result = Processing.SelectiveErosion3d( foam_sep, 3, 14 );

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