ImageDev

DilationDisk2d

Performs a two-dimensional dilation using a structuring element matching with a disk.

Access to parameter description

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

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > dilationDisk2d( std::shared_ptr< iolink::ImageView > inputImage, uint32_t kernelRadius, DilationDisk2d::Precision precision, std::shared_ptr< iolink::ImageView > outputImage = nullptr );
This function returns outputImage.
// Function prototype.
dilation_disk_2d(input_image: idt.ImageType,
                 kernel_radius: int = 3,
                 precision: DilationDisk2d.Precision = DilationDisk2d.Precision.FASTER,
                 output_image: idt.ImageType = None) -> idt.ImageType
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
DilationDisk2d( IOLink.ImageView inputImage,
                UInt32 kernelRadius = 3,
                DilationDisk2d.Precision precision = ImageDev.DilationDisk2d.Precision.FASTER,
                IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. The image type can be integer or float. Image Binary, Label, Grayscale or Multispectral nullptr
input
kernelRadius
The length of the disk radius in pixels. 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 8 and 4 neighborhoods.
PRECISE The operation is computed with the precise mode (slower), which ensures a real circular 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
Parameter Name Description Type Supported Values Default Value
input
input_image
The input image. The image type can be integer or float. image Binary, Label, Grayscale or Multispectral None
input
kernel_radius
The length of the disk radius in pixels. 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 8 and 4 neighborhoods.
PRECISE The operation is computed with the precise mode (slower), which ensures a real circular structuring element.
enumeration FASTER
output
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
input
inputImage
The input image. The image type can be integer or float. Image Binary, Label, Grayscale or Multispectral null
input
kernelRadius
The length of the disk radius in pixels. 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 8 and 4 neighborhoods.
PRECISE The operation is computed with the precise mode (slower), which ensures a real circular structuring element.
Enumeration FASTER
output
outputImage
The output image. Its dimensions and type are forced to the same values as the input image. Image null

Object Examples

auto polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

DilationDisk2d dilationDisk2dAlgo;
dilationDisk2dAlgo.setInputImage( polystyrene );
dilationDisk2dAlgo.setKernelRadius( 3 );
dilationDisk2dAlgo.setPrecision( DilationDisk2d::Precision::FASTER );
dilationDisk2dAlgo.execute();

std::cout << "outputImage:" << dilationDisk2dAlgo.outputImage()->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

dilation_disk_2d_algo = imagedev.DilationDisk2d()
dilation_disk_2d_algo.input_image = polystyrene
dilation_disk_2d_algo.kernel_radius = 3
dilation_disk_2d_algo.precision = imagedev.DilationDisk2d.FASTER
dilation_disk_2d_algo.execute()

print("output_image:", str(dilation_disk_2d_algo.output_image))
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

DilationDisk2d dilationDisk2dAlgo = new DilationDisk2d
{
    inputImage = polystyrene,
    kernelRadius = 3,
    precision = DilationDisk2d.Precision.FASTER
};
dilationDisk2dAlgo.Execute();

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

Function Examples

auto polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );

auto result = dilationDisk2d( polystyrene, 3, DilationDisk2d::Precision::FASTER );

std::cout << "outputImage:" << result->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

result = imagedev.dilation_disk_2d(polystyrene, 3, imagedev.DilationDisk2d.FASTER)

print("output_image:", str(result))
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );

IOLink.ImageView result = Processing.DilationDisk2d( polystyrene, 3, DilationDisk2d.Precision.FASTER );

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