This algorithm removes the light points in a dark image (reconstruction by dilation) or the dark points in a
light image (reconstruction by erosion).
This algorithm is based on a recursive method whereby the minimum between the dilated or eroded image and
the mask image is retained and used as the marker image for the next step.
At each step, the marker image is dilated or eroded by a structuring element of size 1.
This operation is repeated until stability. Therefore, the number of iterations depends on the input image
and the marker image.
As shown in Figure 1, peaks and ridges are leveled down with a reconstruction by dilation, which results
in a much more homogeneous output image.
Figure 1. One-dimensional example of a reconstruction by dilation
As shown in Figure 2, the valleys are leveled up with a reconstruction by erosion, which results in a much
more homogeneous output image.
Figure 2. One-dimensional example of a reconstruction by erosion
// Command constructor.GrayscaleReconstruction3d();/// Gets the inputImage parameter./// The grayscale input mask image constraining reconstruction.
std::shared_ptr< iolink::ImageView> inputImage()const;/// Sets the inputImage parameter./// The grayscale input mask image constraining reconstruction.void setInputImage( std::shared_ptr< iolink::ImageView> inputImage );/// Gets the inputMarkerImage parameter./// The grayscale input marker image containing seeds for reconstruction. It must have the same dimensions and type as the input image.
std::shared_ptr< iolink::ImageView> inputMarkerImage()const;/// Sets the inputMarkerImage parameter./// The grayscale input marker image containing seeds for reconstruction. It must have the same dimensions and type as the input image.void setInputMarkerImage( std::shared_ptr< iolink::ImageView> inputMarkerImage );/// Gets the reconstructionType parameter./// The type of reconstruction algorithm to apply.GrayscaleReconstruction3d::ReconstructionType reconstructionType()const;/// Sets the reconstructionType parameter./// The type of reconstruction algorithm to apply.void setReconstructionType(constGrayscaleReconstruction3d::ReconstructionType& reconstructionType );/// Gets the neighborhood parameter./// The 3D neighborhood configuration for performing dilations or erosions.GrayscaleReconstruction3d::Neighborhood neighborhood()const;/// Sets the neighborhood parameter./// The 3D neighborhood configuration for performing dilations or erosions.void setNeighborhood(constGrayscaleReconstruction3d::Neighborhood& neighborhood );/// Gets the outputImage parameter./// The output image. Its dimensions and type are forced to the same values as the input.
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.void setOutputImage( std::shared_ptr< iolink::ImageView> outputImage );// Method to launch the command.void execute();
# Property of the inputImage parameter.GrayscaleReconstruction3d.input_image
# Property of the inputMarkerImage parameter.GrayscaleReconstruction3d.input_marker_image
# Property of the reconstructionType parameter.GrayscaleReconstruction3d.reconstruction_type
# Property of the neighborhood parameter.GrayscaleReconstruction3d.neighborhood
# Property of the outputImage parameter.GrayscaleReconstruction3d.output_image
// Method to launch the command.
execute()
// Command constructor.GrayscaleReconstruction3d()// Property of the inputImage parameter.GrayscaleReconstruction3d.inputImage
// Property of the inputMarkerImage parameter.GrayscaleReconstruction3d.inputMarkerImage
// Property of the reconstructionType parameter.GrayscaleReconstruction3d.reconstructionType
// Property of the neighborhood parameter.GrayscaleReconstruction3d.neighborhood
// Property of the outputImage parameter.GrayscaleReconstruction3d.outputImage
// Method to launch the command.Execute()
Parameters
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The grayscale input mask image constraining reconstruction.
Image
Binary, Label or Grayscale
nullptr
inputMarkerImage
The grayscale input marker image containing seeds for reconstruction. It must have the same dimensions and type as the input image.
Image
Binary, Label, Grayscale or Multispectral
nullptr
reconstructionType
The type of reconstruction algorithm to apply.
DILATION
The reconstruction is performed by dilation. This mode removes the light points in a dark image.
EROSION
The reconstruction is performed by dilation. This mode removes the dark points in a light image.
Enumeration
DILATION
neighborhood
The 3D neighborhood configuration for performing dilations or erosions.
CONNECTIVITY_6
The structuring element is composed of voxels with a common face with the voxel of interest.
CONNECTIVITY_18
The structuring element is composed of voxels with at least one common edge.
CONNECTIVITY_26
The structuring element is a full cube.
Enumeration
CONNECTIVITY_26
outputImage
The output image. Its dimensions and type are forced to the same values as the input.
Image
nullptr
Parameter Name
Description
Type
Supported Values
Default Value
input_image
The grayscale input mask image constraining reconstruction.
image
Binary, Label or Grayscale
None
input_marker_image
The grayscale input marker image containing seeds for reconstruction. It must have the same dimensions and type as the input image.
image
Binary, Label, Grayscale or Multispectral
None
reconstruction_type
The type of reconstruction algorithm to apply.
DILATION
The reconstruction is performed by dilation. This mode removes the light points in a dark image.
EROSION
The reconstruction is performed by dilation. This mode removes the dark points in a light image.
enumeration
DILATION
neighborhood
The 3D neighborhood configuration for performing dilations or erosions.
CONNECTIVITY_6
The structuring element is composed of voxels with a common face with the voxel of interest.
CONNECTIVITY_18
The structuring element is composed of voxels with at least one common edge.
CONNECTIVITY_26
The structuring element is a full cube.
enumeration
CONNECTIVITY_26
output_image
The output image. Its dimensions and type are forced to the same values as the input.
image
None
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The grayscale input mask image constraining reconstruction.
Image
Binary, Label or Grayscale
null
inputMarkerImage
The grayscale input marker image containing seeds for reconstruction. It must have the same dimensions and type as the input image.
Image
Binary, Label, Grayscale or Multispectral
null
reconstructionType
The type of reconstruction algorithm to apply.
DILATION
The reconstruction is performed by dilation. This mode removes the light points in a dark image.
EROSION
The reconstruction is performed by dilation. This mode removes the dark points in a light image.
Enumeration
DILATION
neighborhood
The 3D neighborhood configuration for performing dilations or erosions.
CONNECTIVITY_6
The structuring element is composed of voxels with a common face with the voxel of interest.
CONNECTIVITY_18
The structuring element is composed of voxels with at least one common edge.
CONNECTIVITY_26
The structuring element is a full cube.
Enumeration
CONNECTIVITY_26
outputImage
The output image. Its dimensions and type are forced to the same values as the input.