This algorithm successively runs a DilationBall3d and an ErosionBall3d with the same kernel.
This command supports two modes: a fast mode that approximates a spherical structuring element by combining
erosions and dilations using 6, 18 and 26 neighborhoods, and a precise mode (slower) that ensures a real
spherical structuring element. The mode can be selected with the precision parameter.
With a classic implementation, morphological closing systematically considers areas out of the image as a
replication of the image borders at each step of the algorithm. Therefore, when applying a closing, some
objects close to the image borders may be connected to the border at the dilation step and not be retro
propagated after the dilation, while one would expect to keep them disconnected from the border. 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 Closing2d documentation (Figure 2).
// Command constructor.ClosingBall3d();/// Gets the inputImage parameter./// The input image. The image type can be integer or float.
std::shared_ptr< iolink::ImageView> inputImage()const;/// Sets the inputImage parameter./// The input image. The image type can be integer or float.void setInputImage( std::shared_ptr< iolink::ImageView> inputImage );/// Gets the kernelRadius parameter./// The length of the sphere radius in voxels.uint32_t kernelRadius()const;/// Sets the kernelRadius parameter./// The length of the sphere radius in voxels.void setKernelRadius(constuint32_t& kernelRadius );/// Gets the precision parameter./// The precision of the computation method.ClosingBall3d::Precision precision()const;/// Sets the precision parameter./// The precision of the computation method.void setPrecision(constClosingBall3d::Precision& precision );/// Gets the borderPolicy parameter./// The border policy to apply.ClosingBall3d::BorderPolicy borderPolicy()const;/// Sets the borderPolicy parameter./// The border policy to apply.void setBorderPolicy(constClosingBall3d::BorderPolicy& borderPolicy );/// Gets the outputImage parameter./// The output image. Its dimensions and type are forced to the same values as the input image.
std::shared_ptr< iolink::ImageView> outputImage()const;/// Sets the outputImage parameter./// The output image. Its dimensions and type are forced to the same values as the input image.void setOutputImage( std::shared_ptr< iolink::ImageView> outputImage );// Method to launch the command.void execute();
# Property of the inputImage parameter.ClosingBall3d.input_image
# Property of the kernelRadius parameter.ClosingBall3d.kernel_radius
# Property of the precision parameter.ClosingBall3d.precision
# Property of the borderPolicy parameter.ClosingBall3d.border_policy
# Property of the outputImage parameter.ClosingBall3d.output_image
// Method to launch the command.
execute()
// Command constructor.ClosingBall3d()// Property of the inputImage parameter.ClosingBall3d.inputImage
// Property of the kernelRadius parameter.ClosingBall3d.kernelRadius
// Property of the precision parameter.ClosingBall3d.precision
// Property of the borderPolicy parameter.ClosingBall3d.borderPolicy
// Property of the outputImage parameter.ClosingBall3d.outputImage
// Method to launch the command.Execute()
Parameters
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The input image. The image type can be integer or float.
Image
Binary, Label, Grayscale or Multispectral
nullptr
borderPolicy
The border policy to apply.
LIMITED
The limited mode is faster to compute, but can produce the unexpected results for particles close to the image border.
EXTENDED
The Extended mode is slower to compute, but produces the expected results for particles close to the image border.
Enumeration
LIMITED
kernelRadius
The length of the sphere radius in voxels.
UInt32
>=1
3
precision
The precision of the computation method.
FASTER
The operation is computed with a fast mode, which approximates a circular structuring element by combining erosions using 6, 18 and 26 neighborhoods.
PRECISE
The operation is computed with a precise mode (slower), which ensures a real spherical structuring element.
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.
image
Binary, Label, Grayscale or Multispectral
None
border_policy
The border policy to apply.
LIMITED
The limited mode is faster to compute, but can produce the unexpected results for particles close to the image border.
EXTENDED
The Extended mode is slower to compute, but produces the expected results for particles close to the image border.
enumeration
LIMITED
kernel_radius
The length of the sphere radius in voxels.
uint32
>=1
3
precision
The precision of the computation method.
FASTER
The operation is computed with a fast mode, which approximates a circular structuring element by combining erosions using 6, 18 and 26 neighborhoods.
PRECISE
The operation is computed with a precise mode (slower), which ensures a real spherical structuring element.
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.
Image
Binary, Label, Grayscale or Multispectral
null
borderPolicy
The border policy to apply.
LIMITED
The limited mode is faster to compute, but can produce the unexpected results for particles close to the image border.
EXTENDED
The Extended mode is slower to compute, but produces the expected results for particles close to the image border.
Enumeration
LIMITED
kernelRadius
The length of the sphere radius in voxels.
UInt32
>=1
3
precision
The precision of the computation method.
FASTER
The operation is computed with a fast mode, which approximates a circular structuring element by combining erosions using 6, 18 and 26 neighborhoods.
PRECISE
The operation is computed with a precise mode (slower), which ensures a real spherical structuring element.
Enumeration
FASTER
outputImage
The output image. Its dimensions and type are forced to the same values as the input image.