ImageDev

BinarySmoothing3d

Transforms a binary three-dimensional image into another binary image with respect to the real local mean of each voxel neighborhood.

Access to parameter description

This algorithm computes a binary smoothing using a specified window size.
It consists of a two step procedure: Note: the binary smoothing does not preserve the topology of objects.

See also

Function Syntax

This function returns the outputBinaryImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
binarySmoothing3d( std::shared_ptr< iolink::ImageView > inputBinaryImage,
                   int32_t kernelRadiusX,
                   int32_t kernelRadiusY,
                   int32_t kernelRadiusZ,
                   double threshold,
                   std::shared_ptr< iolink::ImageView > outputBinaryImage = NULL );
This function returns the outputBinaryImage output parameter.
// Function prototype.
binary_smoothing_3d( input_binary_image,
                     kernel_radius_x = 3,
                     kernel_radius_y = 3,
                     kernel_radius_z = 3,
                     threshold = 0.5,
                     output_binary_image = None )
This function returns the outputBinaryImage output parameter.
// Function prototype.
public static IOLink.ImageView
BinarySmoothing3d( IOLink.ImageView inputBinaryImage,
                   Int32 kernelRadiusX = 3,
                   Int32 kernelRadiusY = 3,
                   Int32 kernelRadiusZ = 3,
                   double threshold = 0.5,
                   IOLink.ImageView outputBinaryImage = null );

Class Syntax

Parameters

Class Name BinarySmoothing3d

Parameter Name Description Type Supported Values Default Value
input
inputBinaryImage
The input binary image. Image Binary nullptr
input
kernelRadiusX
The horizontal kernel size in voxels. Int32 >=1 3
input
kernelRadiusY
The vertical kernel size in voxels. Int32 >=1 3
input
kernelRadiusZ
The depth kernel size in voxels. Int32 >=1 3
input
threshold
The threshold value applied to the local mean (the minimum volume fraction in the window to set a pixel to 1). Float64 ]0, 1] 0.5
output
outputBinaryImage
The output binary 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" );

BinarySmoothing3d binarySmoothing3dAlgo;
binarySmoothing3dAlgo.setInputBinaryImage( foam_sep );
binarySmoothing3dAlgo.setKernelRadiusX( 3 );
binarySmoothing3dAlgo.setKernelRadiusY( 3 );
binarySmoothing3dAlgo.setKernelRadiusZ( 3 );
binarySmoothing3dAlgo.setThreshold( 0.5 );
binarySmoothing3dAlgo.execute();

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

binary_smoothing_3d_algo = imagedev.BinarySmoothing3d()
binary_smoothing_3d_algo.input_binary_image = foam_sep
binary_smoothing_3d_algo.kernel_radius_x = 3
binary_smoothing_3d_algo.kernel_radius_y = 3
binary_smoothing_3d_algo.kernel_radius_z = 3
binary_smoothing_3d_algo.threshold = 0.5
binary_smoothing_3d_algo.execute()

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

BinarySmoothing3d binarySmoothing3dAlgo = new BinarySmoothing3d
{
    inputBinaryImage = foam_sep,
    kernelRadiusX = 3,
    kernelRadiusY = 3,
    kernelRadiusZ = 3,
    threshold = 0.5
};
binarySmoothing3dAlgo.Execute();

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

Function Examples

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

auto result = binarySmoothing3d( foam_sep, 3, 3, 3, 0.5 );

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

result = imagedev.binary_smoothing_3d( foam_sep, 3, 3, 3, 0.5 )

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

IOLink.ImageView result = Processing.BinarySmoothing3d( foam_sep, 3, 3, 3, 0.5 );

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