ImageDev

OpeningBallByReconstruction3d

Performs a three-dimensional opening by reconstruction with a structuring element matching with a sphere.

Access to parameter description

An opening by reconstruction consists in applying an erosion followed by a morphological reconstruction. In the binary case, opening by reconstruction can be used for removing small objects without modifying edges of the large ones. In the grayscale case, opening by reconstruction can be used for performing a Top Hat by reconstruction for detecting bright small structures without getting artifacts from the boundary concavities of the large ones.
Its 2D binary behavior is illustrated in the OpeningByReconstruction2d documentation (Figure 1).

This algorithm supports two modes: a fast mode that combines erosions using different neighborhoods, and a precise mode (slower) that ensures a real sphere structuring element. The mode can be selected with the precision parameter.

See also

Function Syntax

This function returns the outputImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
openingBallByReconstruction3d( std::shared_ptr< iolink::ImageView > inputImage,
                               uint32_t kernelRadius,
                               OpeningBallByReconstruction3d::Precision precision,
                               std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns the outputImage output parameter.
// Function prototype.
opening_ball_by_reconstruction_3d( input_image,
                                   kernel_radius = 3,
                                   precision = OpeningBallByReconstruction3d.Precision.FASTER,
                                   output_image = None )
This function returns the outputImage output parameter.
// Function prototype.
public static IOLink.ImageView
OpeningBallByReconstruction3d( IOLink.ImageView inputImage,
                               UInt32 kernelRadius = 3,
                               OpeningBallByReconstruction3d.Precision precision = ImageDev.OpeningBallByReconstruction3d.Precision.FASTER,
                               IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Class Name OpeningBallByReconstruction3d

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image Image Binary, Label or Grayscale nullptr
input
kernelRadius
The length of the sphere radius in voxels. UInt32 >=1 3
input
precision
The precision of the computation method.
FASTER The operation is computed with the fast mode, which approximates a circular structuring element by combining erosions using 6, 18 and 26 neighborhoods.
PRECISE The operation is computed with the precise mode (slower), which ensures a real spherical structuring element.
Enumeration FASTER
output
outputImage
The output image. Its dimensions and type are forced to the same values as the input image. Image nullptr

Object Examples

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

OpeningBallByReconstruction3d openingBallByReconstruction3dAlgo;
openingBallByReconstruction3dAlgo.setInputImage( foam );
openingBallByReconstruction3dAlgo.setKernelRadius( 3 );
openingBallByReconstruction3dAlgo.setPrecision( OpeningBallByReconstruction3d::Precision::FASTER );
openingBallByReconstruction3dAlgo.execute();

std::cout << "outputImage:" << openingBallByReconstruction3dAlgo.outputImage()->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

opening_ball_by_reconstruction_3d_algo = imagedev.OpeningBallByReconstruction3d()
opening_ball_by_reconstruction_3d_algo.input_image = foam
opening_ball_by_reconstruction_3d_algo.kernel_radius = 3
opening_ball_by_reconstruction_3d_algo.precision = imagedev.OpeningBallByReconstruction3d.FASTER
opening_ball_by_reconstruction_3d_algo.execute()

print( "output_image:", str( opening_ball_by_reconstruction_3d_algo.output_image ) );
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

OpeningBallByReconstruction3d openingBallByReconstruction3dAlgo = new OpeningBallByReconstruction3d
{
    inputImage = foam,
    kernelRadius = 3,
    precision = OpeningBallByReconstruction3d.Precision.FASTER
};
openingBallByReconstruction3dAlgo.Execute();

Console.WriteLine( "outputImage:" + openingBallByReconstruction3dAlgo.outputImage.ToString() );

Function Examples

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

auto result = openingBallByReconstruction3d( foam, 3, OpeningBallByReconstruction3d::Precision::FASTER );

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

result = imagedev.opening_ball_by_reconstruction_3d( foam, 3, imagedev.OpeningBallByReconstruction3d.FASTER )

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

IOLink.ImageView result = Processing.OpeningBallByReconstruction3d( foam, 3, OpeningBallByReconstruction3d.Precision.FASTER );

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