OpeningBall3d
Performs a three-dimensional opening using a structuring element matching with a sphere.
Access to parameter description
For an introduction:
With a classic implementation, morphological opening systematically considers areas out of the image as a replication of the image borders at each step of the algorithm. Therefore, when applying an opening, some thin object parts cut by the image borders may be removed at the erosion step and not be restored after the dilation, while one would expect to keep them. The borderPolicy parameter manages this case. The default mode, LIMITED, corresponds to the classic behavior. The EXTENDED mode properly manages image borders by extending them by a size equal to the structuring element's. This mode can be slower and more memory consuming, especially when the structuring element size is high.
This option is illustrated in the Opening2d documentation (Figure 2).
See also
Access to parameter description
For an introduction:
- section Mathematical Morphology
- section Introduction To Opening
With a classic implementation, morphological opening systematically considers areas out of the image as a replication of the image borders at each step of the algorithm. Therefore, when applying an opening, some thin object parts cut by the image borders may be removed at the erosion step and not be restored after the dilation, while one would expect to keep them. The borderPolicy parameter manages this case. The default mode, LIMITED, corresponds to the classic behavior. The EXTENDED mode properly manages image borders by extending them by a size equal to the structuring element's. This mode can be slower and more memory consuming, especially when the structuring element size is high.
This option is illustrated in the Opening2d documentation (Figure 2).
See also
Function Syntax
This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > openingBall3d( std::shared_ptr< iolink::ImageView > inputImage, uint32_t kernelRadius, OpeningBall3d::Precision precision, OpeningBall3d::BorderPolicy borderPolicy, std::shared_ptr< iolink::ImageView > outputImage = nullptr );
This function returns outputImage.
// Function prototype. opening_ball_3d(input_image: idt.ImageType, kernel_radius: int = 3, precision: OpeningBall3d.Precision = OpeningBall3d.Precision.FASTER, border_policy: OpeningBall3d.BorderPolicy = OpeningBall3d.BorderPolicy.LIMITED, output_image: idt.ImageType = None) -> idt.ImageType
This function returns outputImage.
// Function prototype. public static IOLink.ImageView OpeningBall3d( IOLink.ImageView inputImage, UInt32 kernelRadius = 3, OpeningBall3d.Precision precision = ImageDev.OpeningBall3d.Precision.FASTER, OpeningBall3d.BorderPolicy borderPolicy = ImageDev.OpeningBall3d.BorderPolicy.LIMITED, IOLink.ImageView outputImage = null );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
inputImage |
The input image. The image type can be integer or float. Default is NULL. | Image | Binary, Label, Grayscale or Multispectral | nullptr | |||||
borderPolicy |
The border policy to apply.
|
Enumeration | LIMITED | ||||||
kernelRadius |
The length of the sphere radius in voxels. | UInt32 | >=1 | 3 | |||||
precision |
The precision of the computation method.
|
Enumeration | FASTER | ||||||
outputImage |
The output image. Its dimensions and type are forced to the same values as the input image. | Image | nullptr |
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
input_image |
The input image. The image type can be integer or float. Default is NULL. | image | Binary, Label, Grayscale or Multispectral | None | |||||
border_policy |
The border policy to apply.
|
enumeration | LIMITED | ||||||
kernel_radius |
The length of the sphere radius in voxels. | uint32 | >=1 | 3 | |||||
precision |
The precision of the computation method.
|
enumeration | FASTER | ||||||
output_image |
The output image. Its dimensions and type are forced to the same values as the input image. | image | None |
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
inputImage |
The input image. The image type can be integer or float. Default is NULL. | Image | Binary, Label, Grayscale or Multispectral | null | |||||
borderPolicy |
The border policy to apply.
|
Enumeration | LIMITED | ||||||
kernelRadius |
The length of the sphere radius in voxels. | UInt32 | >=1 | 3 | |||||
precision |
The precision of the computation method.
|
Enumeration | FASTER | ||||||
outputImage |
The output image. Its dimensions and type are forced to the same values as the input image. | Image | null |
Object Examples
auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" ); OpeningBall3d openingBall3dAlgo; openingBall3dAlgo.setInputImage( foam ); openingBall3dAlgo.setKernelRadius( 3 ); openingBall3dAlgo.setPrecision( OpeningBall3d::Precision::FASTER ); openingBall3dAlgo.setBorderPolicy( OpeningBall3d::BorderPolicy::EXTENDED ); openingBall3dAlgo.execute(); std::cout << "outputImage:" << openingBall3dAlgo.outputImage()->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip")) opening_ball_3d_algo = imagedev.OpeningBall3d() opening_ball_3d_algo.input_image = foam opening_ball_3d_algo.kernel_radius = 3 opening_ball_3d_algo.precision = imagedev.OpeningBall3d.FASTER opening_ball_3d_algo.border_policy = imagedev.OpeningBall3d.EXTENDED opening_ball_3d_algo.execute() print("output_image:", str(opening_ball_3d_algo.output_image))
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" ); OpeningBall3d openingBall3dAlgo = new OpeningBall3d { inputImage = foam, kernelRadius = 3, precision = OpeningBall3d.Precision.FASTER, borderPolicy = OpeningBall3d.BorderPolicy.EXTENDED }; openingBall3dAlgo.Execute(); Console.WriteLine( "outputImage:" + openingBall3dAlgo.outputImage.ToString() );
Function Examples
auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" ); auto result = openingBall3d( foam, 3, OpeningBall3d::Precision::FASTER, OpeningBall3d::BorderPolicy::EXTENDED ); std::cout << "outputImage:" << result->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip")) result = imagedev.opening_ball_3d(foam, 3, imagedev.OpeningBall3d.FASTER, imagedev.OpeningBall3d.EXTENDED) print("output_image:", str(result))
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" ); IOLink.ImageView result = Processing.OpeningBall3d( foam, 3, OpeningBall3d.Precision.FASTER, OpeningBall3d.BorderPolicy.EXTENDED ); Console.WriteLine( "outputImage:" + result.ToString() );